Move fade-in of buffer into AudioTrackAudioOutput, as not every output has same requirement as AudioTrack
@tonihei is already working on this.
Since Sep 2, 2026.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
[REQUIRED] Use case description
I'm using AudioOutput based on libusb, so Android audio stack is uninvolved. DefaultAudioSink adds fade-in to every beginning playback after AudioSink.flush() - see also https://github.com/androidx/media/commit/5e3dcea1bfffff0f641d34829d6965a89c791b68 -, but this isn't needed in this case as it's not going into AudioTrack, and volume fade is already accounted for.
Proposed solution
Move the maybeRampUpVolume() logic into AudioTrackAudioOutput, where it doesn't affect custom audio outputs. The commit and logic was explicitly designed around where AudioTrack does or doesn't fade, and other outputs should add this if needed, or don't add it if not.
Happy to provide a PR for this if this solution makes sense!
Alternatives considered
Add a on/off setting to DefaultAudioSink for this fade which I change in lockstep with output provider.
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.