Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio files are not included in assets when running wail build #3343

Open
glvarnell opened this issue Mar 26, 2024 · 1 comment
Open

Audio files are not included in assets when running wail build #3343

glvarnell opened this issue Mar 26, 2024 · 1 comment

Comments

@glvarnell
Copy link

glvarnell commented Mar 26, 2024

Description

If I create a simple vanilla javascript wails app that just uses fireworks.js everything works including sound when I run wails dev. When I build the application it doesn't look like the mp3 files are included in the assets and I do not get any sound.

To Reproduce

Create a vanilla javascript wails app
wails init -n fireworks -t vanilla -ide vscode

I have tried installing fireworks.js from npm as well as just using the CDN in index.html
Download and place explosion0.mp3, explosion1.mp3 and explosion2.mp3 in the assets folder.
Update the javascript config json to use the audio files.
a small snippet from the config json:
sound: {
enabled: true,
files: [
'./src/assets/explosion0.mp3',
'./src/assets/explosion1.mp3',
'./src/assets/explosion2.mp3'
],
volume: {
min: 4,
max:100
}
}

run wails dev
The audio plays

run wails build
no audio and no mp3 files are placed in dist/assets

Expected behaviour

I expect the assets to be bundled and work from the binary build the same as in the dev build.

Screenshots

No response

Attempted Fixes

No response

System Details

# Wails
Version         | v2.8.0
Package Manager | apt   

# System
┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
| OS           | Ubuntu                                                                            |
| Version      | 23.10                                                                             |
| ID           | ubuntu                                                                            |
| Go Version   | go1.22.0                                                                          |
| Platform     | linux                                                                             |
| Architecture | amd64                                                                             |
| CPU          | AMD Ryzen 7 7735HS with Radeon Graphics                                           |
| GPU 1        | Rembrandt [Radeon 680M] (Advanced Micro Devices, Inc. [AMD/ATI]) - Driver: amdgpu |
| GPU 2        | AD107M [GeForce RTX 4060 Max-Q / Mobile] (NVIDIA Corporation) - Driver: nvidia    |
| Memory       | 15GB                                                                              |
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌──────────────────────────────────────────────────────────────────────────┐
| Dependency | Package Name          | Status    | Version                 |
| *docker    | docker.io             | Installed | 24.0.5                  |
| gcc        | build-essential       | Installed | 12.10ubuntu1            |
| libgtk-3   | libgtk-3-dev          | Installed | 3.24.38-5ubuntu1        |
| libwebkit  | libwebkit2gtk-4.0-dev | Installed | 2.42.5-0ubuntu0.23.10.2 |
| npm        | npm                   | Installed | 10.2.4                  |
| *nsis      | nsis                  | Installed | v3.09-1                 |
| pkg-config | pkg-config            | Installed | 1.8.1                   |
└──────────────────────── * - Optional Dependency ─────────────────────────┘

# Diagnosis
 SUCCESS  Your system is ready for Wails development!

Additional context

Other than this minor issue I am loving wails. Thank you for all the hard work on this wonderful project!

@glvarnell glvarnell added the Bug Something isn't working label Mar 26, 2024
@fyonecon
Copy link

可以将mp3打包在assets里面,并且播放功能正常。
建议你排查:
1️⃣浏览器的console看是否mp3的路径读取错误(你也可以在vscode/jb golang的控制台里面看到静态文件引用情况);
2️⃣检查你的js插件所预定义的mp3格式是否正确。

@leaanthony leaanthony added Not a Wails Issue and removed Bug Something isn't working labels Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants