Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML audio player
QtWS25 Last Chance

QML audio player

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
8 Posts 4 Posters 2.3k Views
  • 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.
  • E Offline
    E Offline
    echo55
    wrote on last edited by
    #1

    Hi everybody,

    i'm currently working on a big project fully in QML and i'm stuck at the moment . i need to integrate an audio player (so play sound , record, select audio input and audio output, show a wave for the sound) inside my QML application.
    I don't find any exemple doing that . Only QT application.

    Do you know how can i do it ?

    Thank you.

    I 1 Reply Last reply
    0
    • E echo55

      Hi everybody,

      i'm currently working on a big project fully in QML and i'm stuck at the moment . i need to integrate an audio player (so play sound , record, select audio input and audio output, show a wave for the sound) inside my QML application.
      I don't find any exemple doing that . Only QT application.

      Do you know how can i do it ?

      Thank you.

      I Offline
      I Offline
      Izba
      wrote on last edited by
      #2

      Hi @echo55 ,

      Have you taken look of this page http://doc.qt.io/qt-5/qml-qtmultimedia-mediaplayer.html ?

      To add audio player you just need to:

      import QtMultimedia 5.8
      
          MediaPlayer {
              id: playMusic
              source: "music.wav"
          }
      
      

      -Izba

      1 Reply Last reply
      0
      • E Offline
        E Offline
        echo55
        wrote on last edited by
        #3

        Hi,
        I did look at this.

        The problem is , if for example i want to do a list of all the available input of the application , how can i do that ?
        I don't see anyway to do it with this component.

        1 Reply Last reply
        0
        • aalexA Offline
          aalexA Offline
          aalex
          wrote on last edited by
          #4

          It seems like what you want to achieve is a video sampler, not a simple player. Sampling is a little bit more complicated than simply playing back sounds.

          Here are a few links that might be useful:

          • https://forum.qt.io/topic/13859/how-to-record-and-play-an-audio-file-in-qml
          • https://stackoverflow.com/questions/9223528/how-to-record-an-audio-and-play-in-qml

          (there might be no recording interface in QML - you might have to implement the backend in C++)

          1 Reply Last reply
          0
          • E Offline
            E Offline
            echo55
            wrote on last edited by
            #5

            Thank you for these links i'll check it . I don't want a video player , just audio.
            Am i really forced to go c++ for backend ?
            I remember that there is a audio player in the qt multimedia example . that can play, register audio and select input and output (audio, not a file )

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi,

              Wouldn't the PlayList QML item ne what you are looking for ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • E Offline
                E Offline
                echo55
                wrote on last edited by
                #7

                http://doc.qt.io/qt-5/qml-qtmultimedia-audio.html
                I'm using this for playing sound and it's working . there is no problem but i want to do a little scrol down menu where i can choose the audio output , i'm sorry if it wasn't clear .
                So for example i put a headphone on my computer i want to do a scroll down menu where i can choose where the audio output goes.

                And also , i didn't find how to record sound with this component . did a miss something ?

                Thank you for all

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  From the looks of it, you may have to implement these control yourself and implement a wrapper for the corresponding C++ classes.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  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