Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for WebAssembly
  4. Qt for WebAssembly can play audio from url
Forum Updated to NodeBB v4.3 + New Features

Qt for WebAssembly can play audio from url

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
2 Posts 2 Posters 334 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Quang Phu
    wrote on 21 Nov 2024, 03:33 last edited by Quang Phu
    #1

    Hello,
    I use Qt 6.8.0, with qml I use Multimedia to play audio

    MediaPlayer {
    autoPlay: true
    loops: MediaPlayer.Infinite
    source: "*.mp3" // url from internet
    audioOutput: AudioOutput {
    volume: moduleController.infoController.musicVolume / 100
    }
    }

    It works perfect on desktop but not in WebAssembly
    So are there any ways to play audio on WebAssembly or I must wait for incoming versions of Qt (Current 6.8.0 is latest)

    1 Reply Last reply
    0
    • U Offline
      U Offline
      UWillno
      wrote on 6 Dec 2024, 08:57 last edited by
      #2

      AutoPlay and loops do not work in Qt 6.8.0/6.8.1. In 6.7.2, autoPlay is normal but there can only be one visible videooutput. Loops does not work either. In addition, your wasm must set the source externally, such as after clicking a button or "Component.onCompleted" . mediaPlayer.source = "xxx.mp3" Also, even if you only play audio, it seems that you need to set videoOutput, and since 6.7.3, there may be memory problems when using loader and mediaplayer. So it's better to avoid using mediaplayer.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved