android报错 not enough memory for AudioTrack size=131296

not enough memory for AudioTrack size=131296
我现在把全部音效的部分都注释了 但是还是闪退


02-16 14:12:11.350 11542-11542/? I/MicroDetectionWorker: #startMicroDetector [speakerMode: 0]
02-16 14:12:11.350 11542-11542/? I/AudioController: Using mInputStreamFactoryBuilder
    Created new AudioSource
02-16 14:12:11.351 11542-11542/? I/MicroDetectionWorker: onReady
02-16 14:12:11.361 11542-17983/? I/MicroRecognitionRunner: Starting detection.
02-16 14:12:11.361 11542-18036/? I/MicrophoneInputStream: mic_starting  SR : 16000 CC : 16 SO : 6
02-16 14:12:11.371 10867-20742/? I/AudioFlinger: AudioFlinger's thread 0xe1483400 tid=20742 ready to run
02-16 14:12:11.371 10867-16145/? E/AudioFlinger: not enough memory for AudioTrack size=131296
02-16 14:12:11.371 10867-16145/? D/MemoryDealer:   AudioTrack (0xe5e9c7f0, size=4194304)
        0: 0xe5e9ccc0 | 0x00000000 | 0x000200E0 | A 
        1: 0xe5e9ce50 | 0x000200E0 | 0x000200E0 | A 
        2: 0xe47be120 | 0x000401C0 | 0x000200E0 | A 
        3: 0xe47be360 | 0x000602A0 | 0x000200E0 | A 
        4: 0xe47be4b0 | 0x00080380 | 0x000200E0 | A 
        5: 0xe47be630 | 0x000A0460 | 0x000200E0 | A 
        6: 0xe47be7b0 | 0x000C0540 | 0x000200E0 | A 
        7: 0xe47be960 | 0x000E0620 | 0x000200E0 | A 
        8: 0xe47beae0 | 0x00100700 | 0x000200E0 | A 
        9: 0xe5e9ce20 | 0x001207E0 | 0x000200E0 | A 
       10: 0xe5b07330 | 0x001408C0 | 0x000200E0 | A 
       11: 0xe5b074d0 | 0x001609A0 | 0x000200E0 | A 
       12: 0xe5b07670 | 0x00180A80 | 0x000200E0 | A 
       13: 0xe5b077f0 | 0x001A0B60 | 0x000200E0 | A 
       14: 0xe5b079b0 | 0x001C0C40 | 0x000200E0 | A 
       15: 0xe5b07b10 | 0x001E0D20 | 0x000200E0 | A 
       16: 0xe5b07cf0 | 0x00200E00 | 0x000200E0 | A 
       17: 0xe47bef10 | 0x00220EE0 | 0x000200E0 | A 
       18: 0xe447f0a0 | 0x00240FC0 | 0x000200E0 | A 
       19: 0xe447f290 | 0x002610A0 | 0x000200E0 | A 

02-16 14:12:11.371 10867-16145/? E/AudioFlinger: createRecordTrack_l() initCheck failed -12; no control block?
02-16 14:12:11.372 11542-18036/? E/IAudioFlinger: createRecord returned error -12
02-16 14:12:11.372 11542-18036/? E/AudioRecord: AudioFlinger could not create record track, status: -12
02-16 14:12:11.373 11542-18036/? E/AudioRecord-JNI: Error creating AudioRecord instance: initialization check failed with status -12.
02-16 14:12:11.373 11542-18036/? E/android.media.AudioRecord: Error code -20 when initializing native AudioRecord object.
02-16 14:12:11.373 11542-18036/? I/MicrophoneInputStream: mic_started  SR : 16000 CC : 16 SO : 6
02-16 14:12:11.375 11542-11542/? I/MicroDetectionWorker: onReady
02-16 14:12:11.376 11542-18036/? I/MicrophoneInputStream: mic_close  SR : 16000 CC : 16 SO : 6
02-16 14:12:11.377 11542-17983/? I/MicroRecognitionRunner: Detection finished
02-16 14:12:11.377 11542-17983/? W/ErrorReporter: reportError [type: 211, code: 524300]: Error reading from input stream
02-16 14:12:11.378 11542-17983/? W/ErrorProcessor: onFatalError, processing error from engine(4)
    com.google.android.apps.gsa.shared.speech.b.g: Error reading from input stream
        at com.google.android.apps.gsa.staticplugins.microdetection.d.k.a(SourceFile:91)
        at com.google.android.apps.gsa.staticplugins.microdetection.d.l.run(Unknown Source:14)
        at com.google.android.libraries.gsa.runner.a.a.b(SourceFile:32)
        at com.google.android.libraries.gsa.runner.a.c.call(Unknown Source:4)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at com.google.android.apps.gsa.shared.util.concurrent.b.g.run(Unknown Source:4)
        at com.google.android.apps.gsa.shared.util.concurrent.b.aw.run(SourceFile:4)
        at com.google.android.apps.gsa.shared.util.concurrent.b.aw.run(SourceFile:4)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)
        at com.google.android.apps.gsa.shared.util.concurrent.b.i.run(SourceFile:6)
     Caused by: com.google.android.apps.gsa.shared.exception.GsaIOException: Error code: 393238 | Buffer overflow, no available space.
        at com.google.android.apps.gsa.speech.audio.Tee.j(SourceFile:103)
        at com.google.android.apps.gsa.speech.audio.au.read(SourceFile:2)
        at java.io.InputStream.read(InputStream.java:101)
        at com.google.android.apps.gsa.speech.audio.ao.run(SourceFile:17)
        at com.google.android.apps.gsa.speech.audio.an.run(SourceFile:2)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458) 
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
        at com.google.android.apps.gsa.shared.util.concurrent.b.g.run(Unknown Source:4) 
        at com.google.android.apps.gsa.shared.util.concurrent.b.aw.run(SourceFile:4) 
        at com.google.android.apps.gsa.shared.util.concurrent.b.aw.run(SourceFile:4) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:764) 
        at com.google.android.apps.gsa.shared.util.concurrent.b.i.run(SourceFile:6) 
02-16 14:12:11.379 11542-17983/? I/AudioController: internalShutdown
02-16 14:12:11.379 11542-12096/? I/MicroRecognitionRunner: Stopping hotword detection.
02-16 14:12:11.380 11542-11542/? I/MicroDetector: Keeping mic open: false
02-16 14:12:11.380 11542-11542/? I/MicroDetectionWorker: #onError(false)
02-16 14:12:11.380 11542-20736/? I/DeviceStateChecker: DeviceStateChecker cancelled

2个回答

线程读数据时候有问题 缓冲数据溢出 这个得看具体代码了

WZE18357121535
WZE18357121535 回复qq_36544007: 你怎么项目重新我的是安卓的插件太多 就会包这个 吧个别插件删了就不会 但是需要用到插件啊
3 个月之前 回复
qq_41903026
qq_41903026 能不能告诉我们应该修改哪里,线程吗
6 个月之前 回复
qq_36544007
这次选左边 我重写项目 好使了 但还是不知道怎么回事 就这样吧 谢谢
8 个月之前 回复

内存不足 可以贴一下代码吗

qq_36544007
这次选左边 我重写项目 好使了 但还是不知道怎么回事 就这样吧 谢谢
8 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!