clarkluo2004 的 Android的DTMF处理(ToneGenerator)
The streame type used for tone playback (e.g. STREAM_MUSIC). volume The volume of the tone, given in percentage of maximum volume (from 0-100).
Android关于DTMF处理的一个类:android.media.ToneGenerator;
(ToneGenerator类的源代码在:/frameworks/base/media/java/android/media/ToneGenerator.java)
(另外还需要对照frameworks/base/media/libmedia/ToneGenerator.cpp,此处以C++实现ToneGenerator功能)
//构造函数
public ToneGenerator(int streamType, int volume);
其中参数:
streamType
enum stream_type {
DEFAULT =-1,
VOICE_CALL = 0,
SYSTEM = 1,
RING = 2,
MUSIC = 3,
ALARM = 4,
NUM_STREAM_TYPES
};
(枚举类型stream_type是在AudioTrack.cpp中定义的)