startPlayerFromBuffer failure
See original GitHub issueVersion of flutter_sound
2.1.1
flutter doctor
[✓] Flutter (Channel dev, v1.15.3, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2) [✓] Android Studio (version 3.6) [✓] VS Code (version 1.42.1) [✓] Connected device (1 available)
• No issues found!
Platforms you faced the error (IOS or Android or both?)
Android 9
Expected behavior
Play sound from a flutter asset.
Actual behavior
PlatformException(ERR_UNKNOWN, ERR_UNKNOWN, Prepare failed.: status=0x1)
Tested environment (Emulator? Real Device?)
Real device, Poco F1 with OmniROM
Steps to reproduce the behavior
I was trying to play an audio file from a small asset. The temporary file created in the Java backend is not world readable, so Android cannot prepare the playback session.
Future<void> _playBeep(BuildContext context) async {
final beep = await DefaultAssetBundle.of(context).load('assets/scanner_beep.ac3');
final flutterSound = new FlutterSound();
final playback = new Completer.sync();
await flutterSound.startPlayerFromBuffer(beep.buffer.asUint8List(), codec: t_CODEC.CODEC_AAC);
final subscription = flutterSound.onPlayerStateChanged.listen((event) {
if (event == null) {
return;
}
if (event.currentPosition == event.duration) {
playback.complete();
}
});
await playback.future;
subscription.cancel();
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:13
Top Results From Across the Web
startPlayerFromBuffer failure · Issue #233 - GitHub
Play sound from a flutter asset. Actual behavior. PlatformException(ERR_UNKNOWN, ERR_UNKNOWN, Prepare failed.: status=0x1). Tested environment ( ...
Read more >flutter_sound 7.6.4+2 | Flutter Package - Pub.dev
... if an App wants to play an asset file he must use "StartPlayerFromBuffer(). ... the audio channel, it can have problems with...
Read more >What is the fastest way to start playing audio in QT application
First, invoking the QMediaPlayer with "LowLatency", is not meant for music, it is only for beeps, ringtones .. this is stated in QT ......
Read more >Flutter Audio Player and Recorder - FlutterCore
Start player from buffer. For playing data from a memory buffer instead of a file, you can do the following : Uint8List buffer...
Read more >[Solved]-How do i reproduce audio from List<int> in flutter?
... called startPlayerFromBuffer method https://pub.dev/packages/flutter_sound ... RenderFlex overflowed error only appears in the widget test, if i run the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry, I doubt I can help you in your problem. I made this experiment a year ago and I was not really happy with what I found about Android codec support and the specificity of error codes. If you are planning to integrate conversion into your application, the
ffmpeg
library is a good place to start with.Thanks for the info. @wigy-opensource-developer