You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -172,6 +172,37 @@ subscription?.remove();
172
172
playbackSubscription?.remove();
173
173
```
174
174
175
+
### Stopping Audio Playback
176
+
177
+
```typescript
178
+
import { ExpoStreamer } from'expo-streamer';
179
+
180
+
// Graceful stop - allows buffered audio to finish
181
+
awaitExpoStreamer.stopAudio();
182
+
183
+
// Immediate flush - clears buffer and stops mid-stream
184
+
awaitExpoStreamer.flushAudio();
185
+
```
186
+
187
+
**When to use `stopAudio()` vs `flushAudio()`:**
188
+
189
+
-**`stopAudio()`**: Use when you want to gracefully stop playback, allowing any buffered audio to finish playing. Good for natural conversation endings.
190
+
191
+
-**`flushAudio()`**: Use when you need to immediately stop all audio output, such as when the user interrupts or cancels playback. This clears all scheduled audio buffers without waiting for them to drain.
0 commit comments