tone-generator

ToneGenerator crashes in android 6.0

扶醉桌前 提交于 2020-01-20 07:24:27
问题 In my application i am using ToneGenerator to play simple sound. When test my application by compiling the application with 6.0, my application randomy crashing due to ToneGenerator init method. Below is the exception. java.lang.RuntimeException: Init failed 04-21 12:34:05.497 7166 7166 E MyApplication: at android.media.ToneGenerator.native_setup(Native Method) 04-21 12:34:05.497 7166 7166 E MyApplication: at android.media.ToneGenerator.<init>(ToneGenerator.java:746) I am using the tone

ToneGenerator crashes in android 6.0

本小妞迷上赌 提交于 2020-01-20 07:21:25
问题 In my application i am using ToneGenerator to play simple sound. When test my application by compiling the application with 6.0, my application randomy crashing due to ToneGenerator init method. Below is the exception. java.lang.RuntimeException: Init failed 04-21 12:34:05.497 7166 7166 E MyApplication: at android.media.ToneGenerator.native_setup(Native Method) 04-21 12:34:05.497 7166 7166 E MyApplication: at android.media.ToneGenerator.<init>(ToneGenerator.java:746) I am using the tone

Error generating beep using ToneGenerator class

China☆狼群 提交于 2019-12-10 19:39:57
问题 I'm new to android development I'm working in an android app that simply changes volume and play beep "to preview current sound level" I use startTone in ToneGenerator class to generate this beep , like this : ToneGenerator tg = new ToneGenerator(AudioManager.STREAM_RING, 100); tg.startTone(ToneGenerator.TONE_PROP_BEEP); but sometimes this code doesn't work and generate following exceptions 11-20 00:32:44.262: E/AudioTrack(4701): AudioFlinger could not create track, status: -12 11-20 00:32:44