如何在android中以编程方式在立体声和单声道之间切换音频输出模式?

时间:2016-01-20 07:10:47

标签: android audio audiotrack

实际上我正在尝试制作一个自定义音乐播放器应用程序,其中我只想让用户有机会将音频输出更改为立体声和单声道。

1 个答案:

答案 0 :(得分:2)

您可以设置何时创建 <core-collapse vertical layout opened="false" id="{{test.name}}"> <template repeat="{{user in test.users }}"> <paper-item style="margin-left: 5%" on-tap="{{collapseDevice}}"> {{users.name}} </paper-item> </template> </core-collapse>

的实例
AudioTrack

如果要在运行时创建 /* Create AudioTrack instance */ AudioTrack mAudioTrack = null; int minSize = AudioTrack.getMinBufferSize( 16000, AudioFormat.CHANNEL_OUT_MONO, // or set AudioFormat.CHANNEL_OUT_STEREO AudioFormat.ENCODING_PCM_16BIT); if (mAudioTrack == null) { mAudioTrack = new AudioTrack( AudioManager.STREAM_MUSIC, 16000, AudioFormat.CHANNEL_OUT_MONO, // or set AudioFormat.CHANNEL_OUT_STEREO AudioFormat.ENCODING_PCM_16BIT, minSize, AudioTrack.MODE_STREAM); } /* Create AudioTrack instance */ /* Stop and release AudioTrack instance */ mAudioTrack.flush(); mAudioTrack.stop(); mAudioTrack.release(); mAudioTrack = null; /* Stop and release AudioTrack instance */ 的新实例,先发布先前的实例。