Show waveform from mp3 file on mac
-
Re: Generating a waveform from an audio (or video) file?
Hello,
I need to display a waveform from an user audio file (let's say an mp3 file) in a cross platform way.
On windows I could use QAudioDecoder to access audio samples and build the waveform image.
As QAudioDecoder isn't handled on macos, could you please give me a hint about how to acheive this?
(the Spectrum example - closest to my point - only handles wav files with a home made header parsing, but I need to read more file types than that)Thank you!
-
I'm not a sound engineer, but I believe waveform isn't directly applicable to MP3. I think you need to extract the audio into PCM and generate a waveform graph based on the amplitude of the individual uncompressed samples.
-
Yes, and the main question is : how can I "extract the audio into PCM" with Qt on a mac ?
I can resume this with 2 problems there :
-first, mp3 file interpretation (just playing the sound would be one good starting step)
-second, access final stream data (the samples so I can build the waveform image)
It seems that both these operations are complicated without QAudioDecoder or QMediaPlayer handling mp3 files on macI think you're right though : mp3 representation in not based on samples. But, still, samples are what will be fed to the speakers, so someone in there will make the translation. I just need it not to be a black box: is this possible?
-
there are open source MP3 decoder libraries. google search: "mp3 decoder library sourcecode"...