Sound Effects Sometimes Not Played on Android 6.0-7.0 Devices
Closed this issue · 3 comments
On Android 6.0-7.0 devices, sound effects fail to be played, with the following logs reported in logcat:
W/AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 4, track 32000 Hz, output 44100 Hz
This has been observed on Nexus 4 emulator profiles running Android 6.0 and Android 7.0. This problem may be related to issue #1 .
According to preliminary research, this issue is caused by audio files using sample sizes that don't match the device's native sample size.
It seems this problem is quite apparent on Android 6.0 and 7.0 when playing sound effect files that have sample sizes that differ from the device itself (i.e. 32000 vs 48000). Ensuring that all sound effect files have the same sample size as the device seems to mitigate this issue.
UPDATE: The issue still seems to occur despite playing audio files with the same sample size.
It seems that this is a related issue: https://issuetracker.google.com/issues/37131057