Get format from audio file dynamically

  • Hello,
    I want to build a music player and support files like mp3 or vorbiss. Each music files will be treated so I need to use the QAudioDecoder class.
    I've managed to open wav files with static audio format but i need to get audio format from each files and i don't really get how to do that.
    Is there a class in Qt that can help me ?

    Thank you

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What do you mean by "treated" ?

  • Hi SGaist,

    I want to normalize sounds in "realtime" in two phases.
    Firstly, I need to do a moving average treatment on the signal to make it smoother and get the maximum amplitude.
    Secondly, i'll normalize the volume of the sound in the same time it is playing.

    sorry for my poor english :)

  • Lifetime Qt Champion

    You can get the info from the QAudioDecoder class which by defaults sets the format to the one of the media you opened.

    If I understood correctly you can also assign the format you would like to have but you have to do it when the decoder is stopped.

Log in to reply