How to Create an array of QSound or Qmediaplayer?



  • Hello everyone, this is my first post here on QT Forum. Im currently developing a program for a school assignment, and am having some troubles.

    i want to create a sort of rhythm machine where you have a set of 8 pushbuttons with drum sounds.

    And the user will be able to choose which sounds to play in 16 beat tempo.

    i was thinking about creating an array of Qsounds or Qmediaplayer to do it, but still dont know how to go about this.

    There arent many QT music related developed softwares on the internet to search for, at least i cannot find many.

    Can someone help me with this?

    thanks in advance



  • Maybe a deeper look to this Class helps. http://doc.qt.io/qt-5/qmediaplayer.html

    You can save the Files in a Mediaplaylist with only one player.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    That's because the QtMultimedia modules is currently not suited for advanced audio mixing. Since you plan multiple tracks to be played independently you should rather look for a more suited audio processing library and use Qt to build the other parts on top of it. Note that you can still use QAudioOutput to listen to the result of your mix.

    Hope it helps


  • Qt Champions 2016

    hi
    You could take inspiration in some of the existing sounds programs.
    https://qtractor.sourceforge.io/
    (linux)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.