在语言Flutter,每次我运行一个应用程序与音频文件,音频文件不播放,显示此长错误s

cedebl8k  于 2023-01-09  发布在  Flutter
关注(0)|答案(1)|浏览(189)

Launching lib\main.dart on Android SDK built for x86 in debug mode... lib\main.dart:1 E/flutter ( 6606): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(Unexpected error!, Changing the playback rate is only available for Android M/23+ or using LOW_LATENCY mode., java.lang.IllegalStateException: Changing the playback rate is only available for Android M/23+ or using LOW_LATENCY mode. E/flutter ( 6606): at xyz.luan.audioplayers.player.MediaPlayerPlayer.setRate(MediaPlayerPlayer.kt:45) E/flutter ( 6606): at xyz.luan.audioplayers.player.WrappedPlayer.configAndPrepare(WrappedPlayer.kt:307) E/flutter ( 6606): at xyz.luan.audioplayers.player.WrappedPlayer.setSource(WrappedPlayer.kt:31) E/flutter ( 6606): at xyz.luan.audioplayers.AudioplayersPlugin.handler(AudioplayersPlugin.kt:91) E/flutter ( 6606): at xyz.luan.audioplayers.AudioplayersPlugin.access$handler(AudioplayersPlugin.kt:25) 2 E/flutter ( 6606): at xyz.luan.audioplayers.AudioplayersPlugin$onAttachedToEngine$1$1.invoke(AudioplayersPlugin.kt:41) E/flutter ( 6606): at xyz.luan.audioplayers.AudioplayersPlugin$safeCall$1.invokeSuspend(AudioplayersPlugin.kt:62) E/flutter ( 6606): at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) E/flutter ( 6606): at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) E/flutter ( 6606): at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42) E/flutter ( 6606): at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95) E/flutter ( 6606): at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) E/flutter ( 6606): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
This is the error showing

eit6fx6z

eit6fx6z1#

检查错误,它表明只有Android 23+支持更改播放速率。因此,您可以删除该部分代码或在Gradle文件中将minSdk更改为23。或者,根据错误建议,使用低延迟模式此参数在“播放”功能中可用。

相关问题