Closed schuranator closed 8 months ago
Hi!
Example code:
audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
AudioDeviceInfo speakerphoneDevice = getAudioDevice(AudioDeviceInfo.TYPE_BUILTIN_SPEAKER);
if (speakerphoneDevice != null) {
success = audioManager.setCommunicationDevice(speakerphoneDevice);
if (success) {
audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
} else {
Log.d(TAG, "Speaker error");
}
}
I hope it helps you
I tried this workflow but still have the cut out after a few seconds of playing. I have a better log not sure if this helps. AudioSwitchLog.txt
I am experiencing the same issue. After switching to MODE_IN_COMMUNICATION, after about 5 seconds, the mode auto switches to MODE_NORMAL.
I tried @angeloraso example code and I still see the problem.
@schuranator I've been unable to reproduce the issue so far. Can you add a log file with AudioSwitch.loggingEnabled = true
set where you encounter this issue?
Closing due to a lack of customer response.
I'm noticing issues with the Samsung S7+ Android 12 and 13 along with the Pixel 7 Android 13.
I created a small Activity that would allow me to toggle which audio output to use. The toggle works initially but after 5-10 seconds I see the audio get switched back to the USB Headset Audio output.
Here is some logs: 2023-05-23 13:42:52.399 1061-1857 SoundAlive...384 arch64 audioserver I SoundAlive_SRC384: Instance 173 Init(outFs 8, InFs 5, chnum 1, outBW 3, inBW 3) 2023-05-23 13:42:52.399 1061-1857 Samsung_So...SRC arch64 audioserver I SRC384 version Samsung SoundAlive SRC ver320 arch64 2021.08.04 (Cppref for ARM64, ver.300.c 32bit 07_10_2016 based) 2023-05-23 13:42:52.594 1061-1857 SoundAlive...384 arch64 audioserver I ~SoundAlive_SRC384(): instance 173