Skip to content

Commit

Permalink
Update FullGuide.md
Browse files Browse the repository at this point in the history
Note that error callbacks require data callbacks.
  • Loading branch information
philburk authored Jun 10, 2024
1 parent 3489f07 commit da4de45
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/FullGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,11 @@ If you need to be informed when an audio device is disconnected, write a class
which extends `AudioStreamErrorCallback` and then register your class using `builder.setErrorCallback(yourCallbackClass)`. It is recommended to pass a shared_ptr.
If you register a callback, then it will automatically close the stream in a separate thread if the stream is disconnected.

Your callback can implement the following methods (called in a separate thread):
Note that error callbacks will only be called when a data callback has been specified
and the stream is started. If you are not using a data callback then the read(), write()
and requestStart() methods will return errors if the stream is disconnected.

Your error callback can implement the following methods (called in a separate thread):

* `onErrorBeforeClose(stream, error)` - called when the stream has been disconnected but not yet closed,
so you can still reference the underlying stream (e.g.`getXRunCount()`).
Expand Down

0 comments on commit da4de45

Please sign in to comment.