首先简单介绍下预备知识:
1.Android的audio流的类型有以下12种:
- /* The audio stream for phone calls */
- public static final int STREAM_VOICE_CALL = 0;//通话连接时的音频流(通话声)
- /* The audio stream for system sounds */
- public static final int STREAM_SYSTEM = 1;//系统音频流
- /* The audio stream for the phone ring and message alerts */
- public static final int STREAM_RING = 2;//来电铃声
- /* The audio stream for music playback */
- public static final int STREAM_MUSIC = 3;//媒体音频流
- /* The audio stream for alarms */
- public static final int STREAM_ALARM = 4;//闹钟音频流
- /* The audio stream for notifications */
- public static final int STREAM_NOTIFICATION = 5;//通知音频流
- /* @hide The audio stream for phone calls when connected on bluetooth */
- public static final int STREAM_BLUETOOTH_SCO = 6;//从注释上看时使用蓝牙耳机通话的音频流
- /* @hide The audio stream for enforced system sounds in certain countries (e.g camera in Japan) */
- public static final int STREAM_SYSTEM_ENFORCED = 7;//一些国家强制使用的音频流??不太明白
- /* @hide The audio stream for DTMF tones */
- public static final int STREAM_DTMF =