简体   繁体   中英

how to play in earpiece speaker on Android with libpd

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.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM