Skip to content
New issue

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

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

Already on GitHub? # to your account

[bug] I can't play mp3 #9326

Closed
ulizkoigor opened this issue Apr 1, 2024 · 1 comment
Closed

[bug] I can't play mp3 #9326

ulizkoigor opened this issue Apr 1, 2024 · 1 comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@ulizkoigor
Copy link

Describe the bug

I am writing an application in linux OS. I need to play an mp3 file. When I do this:

        const fileName = `audio/sound.mp3`
        const path = await resolveResource(`resources/${fileName}`)
        new Audio(path).play()

there is no sound, but the console outputs "Unhandled Promise Rejection: NotSupportedError: The operation is not supported.".

And when I do that, it doesn't work either:

        const fileName = `audio/sound.mp3`
        const path = await resolveResource(`resources/${fileName}`)
        const assetUrl = convertFileSrc(path)
        new Audio(assetUrl).play()

The error in the console is the same: "Unhandled Promise Rejection: NotSupportedError: The operation is not supported."

I found a lot of topics on this issue here, but I still haven't figured out how to solve this problem. Help please. Thanks.

Reproduction

No response

Expected behavior

No response

Full tauri info output

[✔] Environment
    - OS: Linux Mint 21.3 X64
    ✔ webkit2gtk-4.0: 2.42.5
    ✔ rsvg2: 2.52.5
    ✔ rustc: 1.76.0 (07dca489a 2024-02-04)
    ✔ cargo: 1.76.0 (c84b36747 2024-01-18)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
    - node: 21.7.1
    - npm: 10.5.0

[-] Packages
    - tauri [RUST]: 1.6.1
    - tauri-build [RUST]: 1.5.1
    - wry [RUST]: 0.24.7
    - tao [RUST]: 0.16.7
    - @tauri-apps/api [NPM]: 1.5.3
    - @tauri-apps/cli [NPM]: 1.5.11

[-] App
    - build-type: bundle
    - CSP: default-src 'self'; media-src 'self' asset: https://asset.localhost;
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: Vue.js
    - bundler: Vite

Stack trace

No response

Additional context

No response

@ulizkoigor ulizkoigor added status: needs triage This issue needs to triage, applied to new issues type: bug labels Apr 1, 2024
@FabianLars
Copy link
Member

Duplicate of #3725 (don't mind the video-specific title, it applies to audio too)

@FabianLars FabianLars closed this as not planned Won't fix, can't repro, duplicate, stale Apr 1, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

2 participants