audioplayers
audioplayers copied to clipboard
[QUESTION]: No sound in Windows Release Version
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
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);