You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I made sure that the issue I am raising doesn't already exist
Current bug behaviour
Occurs if you follow the steps in "expected behavior"
Expected behaviour
If you replace "await player.setSource(assetSource('ambient_c_motion.mp3'))" with "await player.play(BytesSource(bytes))" in Windows and start debarking, then the connection to the device is immediately lost
Steps to reproduce
Execute flutter run on the code sample
...
...
Code sample
Code sample
voidmain() {
}
Affected platforms
Windows
Platform details
Windows 11
AudioPlayers Version
^6.1.0
Build mode
No response
Audio Files/URLs/Sources
void initState() {
super.initState();
// Create the audio player.
player = AudioPlayer();
// Set the release mode to keep the source after playback has completed.
player.setReleaseMode(ReleaseMode.stop);
// Start the player as soon as the app is displayed.
WidgetsBinding.instance.addPostFrameCallback((_) async {
//await player.setSource(AssetSource('ambient_c_motion.mp3'));
//await player.play(DeviceFileSource(localFile));
await player.play(BytesSource(bytes));
await player.resume();
});
}
Screenshots
No response
Logs
my relevant logs
Full Logs
my full logs or a link to a gist
Flutter doctor:
Output of: flutter doctor -v
Related issues / more information
No response
Working on PR
no way
The text was updated successfully, but these errors were encountered:
FYI - I'm also on Windows and encountered exactly the same error.
await player.play(BytesSource(bytes));
The cause was that my bytes were raw PCM16 without a wavheader. Added the header and all was well. "Lost connection to device" wasn't the best error but ultimately it was my fault (as usual!)
Checklist
Current bug behaviour
Occurs if you follow the steps in "expected behavior"
Expected behaviour
If you replace "await player.setSource(assetSource('ambient_c_motion.mp3'))" with "await player.play(BytesSource(bytes))" in Windows and start debarking, then the connection to the device is immediately lost
Steps to reproduce
flutter run
on the code sampleCode sample
Code sample
Affected platforms
Windows
Platform details
Windows 11
AudioPlayers Version
^6.1.0
Build mode
No response
Audio Files/URLs/Sources
void initState() {
super.initState();
}
Screenshots
No response
Logs
Full Logs
Flutter doctor:
Related issues / more information
No response
Working on PR
no way
The text was updated successfully, but these errors were encountered: