Route audio signal on a RIoTboard with KitKat

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Route audio signal on a RIoTboard with KitKat

Jump to solution
1,008 Views
Xavier
Contributor III

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!

0 Kudos
1 Solution
756 Views
Xavier
Contributor III

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.

View solution in original post

0 Kudos
4 Replies
757 Views
Xavier
Contributor III

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.

0 Kudos
756 Views
saurabh206
Senior Contributor III

Hi

Xavier

You can support for the ALSA and use aplay to play using different soundcard.

Thanks

Saurabh

756 Views
Xavier
Contributor III

Is there any way to use aplay from an Android application?

0 Kudos
756 Views
saurabh206
Senior Contributor III

Hi Xavier

You can use "executeCommand" from Android application.

Like

executeCommand("cat /proc/version");

Hope this helps.

Thanks

Saurabh