Add isOffloaded method to query AudioTrack offload state.
Open
@tonihei is already working on this.
Since Aug 2, 2022.
enhancement
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
Use case description
The current interface doesn't provide actual status of offload (whether is enabled on the AudioTrack, not whether it's sleeping). It doesn't allow apps making decisions to keep using offload support after a write error, which may be transient.
Requests:
- call a new method AudioOffloadListener.isOffloadedPlayback with the value of AudioTrack.isOffloadedPlayback. This may be true, even when sleepingForOffload is false.
- Allow AudioOffloadListener to be involved in the DefaultAudioSink maybeDisableOffload decision, such as trying additional times with offload enabled.
- Expose the reason for offload being disabled, such as Audio Init errors, or write errors, or not supported for format.
Proposed solution
Add additional methods to AudioOffloadListener that affect the
Alternatives considered
Expose AudioTrack and additional logging.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.