Hi! I'm facing an annoying problem. I'm currently using a RIoTboard (Android KitKat) with speakers connected to the audio output and a screen (built-in speakers) connected to the HDMI output. I want to route audio signals the following ways:
- Same signal towards all the speakers
- One signal towards the speakers and another one towards the screen
Because of all the abstraction layers, I can't find any solution. Here's what I was looking into:
- Using NDK
- Using AudioManager class and its awfully undocumented setParameters method
- "hacking" Android way of managing audio streams by using streams differently (e.g. music -> alarm stream)
Any clues?
Thanks in advance!
Solved! Go to Solution.
In the end, I've chosen to use the Ringtone class. Indeed, some of the signals, when both speakers and screen are connected, are routed towards the speakers (e.g. notifications) while the others are routed towards the screen.
In the end, I've chosen to use the Ringtone class. Indeed, some of the signals, when both speakers and screen are connected, are routed towards the speakers (e.g. notifications) while the others are routed towards the screen.
Hi
Xavier
You can support for the ALSA and use aplay to play using different soundcard.
Thanks
Saurabh
Is there any way to use aplay from an Android application?
Hi Xavier
You can use "executeCommand" from Android application.
Like
executeCommand("cat /proc/version");
Hope this helps.
Thanks
Saurabh