Add BackgroundRunner to HelloOboe (#1669)
If AudioServer has crashed it can cause the UI thread to time out.
So call audio in background thread to prevent ANRs.
Use a HandlerThread to implement a message queue.
Fixes #960
Fixes #1538
Refactor samples (#541)
Refactoring the hello-oboe and MegaDrone samples. Changes include:
- Each sample's audio engine now owns a separate callback object, rather than it _being_ a callback. This decouples the callback from the owning class.
- A new DefaultAudioStreamCallback object implements common useful callback functionality.
- In hello-oboe a customised LatencyTuningCallback is used which automatically adjusts the buffer size of the audio stream based on the number of underruns (more underruns = bigger buffer).
- ManagedStream is used in both samples which simplifies the ownership of an AudioStream object.
- Both samples now have a TappableAudioSource which is an object which can be tapped and renders audio data.
- Duplicated code has been refactored into shared objects, these can be found in the samples/shared folder.
Thanks to @atneya who implemented the vast majority of these changes.
Refactor samples (#541)
Refactoring the hello-oboe and MegaDrone samples. Changes include:
- Each sample's audio engine now owns a separate callback object, rather than it _being_ a callback. This decouples the callback from the owning class.
- A new DefaultAudioStreamCallback object implements common useful callback functionality.
- In hello-oboe a customised LatencyTuningCallback is used which automatically adjusts the buffer size of the audio stream based on the number of underruns (more underruns = bigger buffer).
- ManagedStream is used in both samples which simplifies the ownership of an AudioStream object.
- Both samples now have a TappableAudioSource which is an object which can be tapped and renders audio data.
- Duplicated code has been refactored into shared objects, these can be found in the samples/shared folder.
Thanks to @atneya who implemented the vast majority of these changes.
Refactor samples (#541)
Refactoring the hello-oboe and MegaDrone samples. Changes include:
- Each sample's audio engine now owns a separate callback object, rather than it _being_ a callback. This decouples the callback from the owning class.
- A new DefaultAudioStreamCallback object implements common useful callback functionality.
- In hello-oboe a customised LatencyTuningCallback is used which automatically adjusts the buffer size of the audio stream based on the number of underruns (more underruns = bigger buffer).
- ManagedStream is used in both samples which simplifies the ownership of an AudioStream object.
- Both samples now have a TappableAudioSource which is an object which can be tapped and renders audio data.
- Duplicated code has been refactored into shared objects, these can be found in the samples/shared folder.
Thanks to @atneya who implemented the vast majority of these changes.