firemonkey - How do I make a beep sound in Android using Delphi and the API? -


after having @ androidapi.jni.media.pas, coded following procedure:

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; 

but can't figure out how set value streamtype? thanks

the stream type identify stream on beep must played. integer between 0 , 4 :

  • stream_voice_call (0)
  • stream_system (1)
  • stream_ring (2)
  • stream_music(3)
  • stream_alarm(4)

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

Kivy: Swiping (Carousel & ScreenManager) -

jdbc - Not able to establish database connection in eclipse -