audioplayers icon indicating copy to clipboard operation
audioplayers copied to clipboard

[QUESTION]: No sound in Windows Release Version

Open michaelniedermayr opened this issue 2 years ago • 1 comments

I have an app that loads a sound file from the assets folder and plays it. If I run the Windows version of this app in Android Studio, everything works well and I can hear the sound. However, if I run the release version (opening the exe-file in build/windows/runner/Release), there is no sound. First, I assumed that maybe the assets are not loaded properly in the release version but this is not the case since the local image are correctly displayed.

Do I miss something?

Versions: audioplayers: ^1.0.1

[√] Flutter (Channel stable, 3.0.5, on Microsoft Windows [Version 10.0.19043.1826], locale en-US) [√] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc3) [√] Chrome - develop for the web [√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.5) [√] Android Studio (version 2021.1) [√] Android Studio (version 2021.2) [√] Connected device (3 available) [√] HTTP Host Availability

michaelniedermayr avatar Aug 09 '22 08:08 michaelniedermayr

I found the problem. I used DeviceFileSource() to load the asset. That works when app is started from Android Studio. However, the proper way to load assets is AssetSource().

AudioPlayer().play(AssetSource(asset);

michaelniedermayr avatar Aug 10 '22 08:08 michaelniedermayr