@@ -114,8 +114,8 @@ impl OfflineAudioContext {
114
114
/// This function will block the current thread and returns the rendered `AudioBuffer`
115
115
/// synchronously.
116
116
///
117
- /// This method will only adhere to scheduled suspensions via [`Self::suspend_at_sync `] and
118
- /// will ignore those provided via [`Self::suspend_at `].
117
+ /// This method will only adhere to scheduled suspensions via [`Self::suspend_sync `] and
118
+ /// will ignore those provided via [`Self::suspend `].
119
119
///
120
120
/// # Panics
121
121
///
@@ -139,8 +139,8 @@ impl OfflineAudioContext {
139
139
/// Rendering is purely CPU bound and contains no `await` points, so calling this method will
140
140
/// block the executor until completion or until the context is suspended.
141
141
///
142
- /// This method will only adhere to scheduled suspensions via [`Self::suspend_at `] and will
143
- /// ignore those provided via [`Self::suspend_at_sync `].
142
+ /// This method will only adhere to scheduled suspensions via [`Self::suspend `] and will
143
+ /// ignore those provided via [`Self::suspend_sync `].
144
144
///
145
145
/// # Panics
146
146
///
@@ -200,7 +200,7 @@ impl OfflineAudioContext {
200
200
/// let context = Arc::new(OfflineAudioContext::new(1, 512, 44_100.));
201
201
/// let context_clone = Arc::clone(&context);
202
202
///
203
- /// let suspend_promise = context.suspend_at (128. / 44_100.).then(|_| async move {
203
+ /// let suspend_promise = context.suspend (128. / 44_100.).then(|_| async move {
204
204
/// let mut src = context_clone.create_constant_source();
205
205
/// src.connect(&context_clone.destination());
206
206
/// src.start();
@@ -213,7 +213,7 @@ impl OfflineAudioContext {
213
213
/// assert_eq!(buffer.number_of_channels(), 1);
214
214
/// assert_eq!(buffer.length(), 512);
215
215
/// ```
216
- pub async fn suspend_at ( & self , suspend_time : f64 ) {
216
+ pub async fn suspend ( & self , suspend_time : f64 ) {
217
217
let quantum = ( suspend_time * self . base . sample_rate ( ) as f64 / RENDER_QUANTUM_SIZE as f64 )
218
218
. ceil ( ) as usize ;
219
219
@@ -240,7 +240,7 @@ impl OfflineAudioContext {
240
240
/// Schedules a suspension of the time progression in the audio context at the specified time
241
241
/// and runs a callback.
242
242
///
243
- /// This is a synchronous version of [`Self::suspend_at `] that runs the provided callback at
243
+ /// This is a synchronous version of [`Self::suspend `] that runs the provided callback at
244
244
/// the `suspendTime`. The rendering resumes automatically after the callback has run, so there
245
245
/// is no `resume_sync` method.
246
246
///
@@ -264,7 +264,7 @@ impl OfflineAudioContext {
264
264
///
265
265
/// let mut context = OfflineAudioContext::new(1, 512, 44_100.);
266
266
///
267
- /// context.suspend_at_sync (128. / 44_100., |context| {
267
+ /// context.suspend_sync (128. / 44_100., |context| {
268
268
/// let mut src = context.create_constant_source();
269
269
/// src.connect(&context.destination());
270
270
/// src.start();
@@ -274,7 +274,7 @@ impl OfflineAudioContext {
274
274
/// assert_eq!(buffer.number_of_channels(), 1);
275
275
/// assert_eq!(buffer.length(), 512);
276
276
/// ```
277
- pub fn suspend_at_sync < F : FnOnce ( & mut Self ) + Send + Sync + ' static > (
277
+ pub fn suspend_sync < F : FnOnce ( & mut Self ) + Send + Sync + ' static > (
278
278
& mut self ,
279
279
suspend_time : f64 ,
280
280
callback : F ,
@@ -340,13 +340,13 @@ mod tests {
340
340
341
341
let mut context = OfflineAudioContext :: new ( 1 , len, sample_rate as f32 ) ;
342
342
343
- context. suspend_at_sync ( RENDER_QUANTUM_SIZE as f64 / sample_rate, |context| {
343
+ context. suspend_sync ( RENDER_QUANTUM_SIZE as f64 / sample_rate, |context| {
344
344
let mut src = context. create_constant_source ( ) ;
345
345
src. connect ( & context. destination ( ) ) ;
346
346
src. start ( ) ;
347
347
} ) ;
348
348
349
- context. suspend_at_sync ( ( 3 * RENDER_QUANTUM_SIZE ) as f64 / sample_rate, |context| {
349
+ context. suspend_sync ( ( 3 * RENDER_QUANTUM_SIZE ) as f64 / sample_rate, |context| {
350
350
context. destination ( ) . disconnect ( ) ;
351
351
} ) ;
352
352
@@ -378,7 +378,7 @@ mod tests {
378
378
let context = Arc :: new ( OfflineAudioContext :: new ( 1 , 512 , 44_100. ) ) ;
379
379
let context_clone = Arc :: clone ( & context) ;
380
380
381
- let suspend_promise = context. suspend_at ( 128. / 44_100. ) . then ( |_| async move {
381
+ let suspend_promise = context. suspend ( 128. / 44_100. ) . then ( |_| async move {
382
382
let mut src = context_clone. create_constant_source ( ) ;
383
383
src. connect ( & context_clone. destination ( ) ) ;
384
384
src. start ( ) ;
0 commit comments