Route audio signal on a RIoTboard with KitKat

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Route audio signal on a RIoTboard with KitKat

跳至解决方案
2,228 次查看
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 项奖励
回复
1 解答
1,976 次查看
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 项奖励
回复
4 回复数
1,977 次查看
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 项奖励
回复
1,976 次查看
saurabh206
Senior Contributor III

Hi

Xavier

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

Thanks

Saurabh

1,976 次查看
Xavier
Contributor III

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

0 项奖励
回复
1,976 次查看
saurabh206
Senior Contributor III

Hi Xavier

You can use "executeCommand" from Android application.

Like

executeCommand("cat /proc/version");

Hope this helps.

Thanks

Saurabh