how to play in earpiece speaker on Android with libpd

72 Views Asked by At

I use AudioParameters.suggestOutputChannels() by PdAudio.initAudio(). The suggested output channel is 2 and the result is the phone speaker goes on.

How to turn on the phone earpiece speaker by libpd in Android?

The AudioManager.STREAM_VOICE_CALL returns 0, but then I do PdAudio.initAudio() with 0 as output channel there is no sound at all.

1

There are 1 best solutions below

0
On

I think i found that there is no straight solution: The libpd contains class AudioWrapper, which creates

track = new AudioTrack(AudioManager.STREAM_MUSIC, sampleRate, channelConfig,
 ENCODING, trackSizeBytes, AudioTrack.MODE_STREAM);

so where is no direct way to overwrite AudioManager.STREAM_MUSIC to AudioManager.STREAM_VOICE_CALL.