看了Androidapi.JNI.Media.pas后,我编写了以下程序:
uses
Androidapi.JNIBridge,
AndroidApi.JNI.Media;
procedure Sound(ADuration: Integer);
implementation
procedure Sound(ADuration: Integer);
var
Volume: Integer;
StreamType: Integer;
ToneType: Integer;
ToneGenerator: JToneGenerator;
begin
Volume := TJToneGenerator.JavaClass.MAX_VOLUME;
StreamType := ?
ToneType := TJToneGenerator.JavaClass.TONE_DTMF_0;
ToneGenerator := TJToneGenerator.JavaClass.init(StreamType, Volume);
ToneGenerator.startTone(ToneType, ADuration);
end;
但我无法弄清楚如何为StreamType设置值? 感谢
答案 0 :(得分:4)
流类型标识必须播放蜂鸣声的流。它是0到4之间的整数: