Simplest way to play mp3 from Visual C++

前端 未结 6 1942
星月不相逢
星月不相逢 2020-12-31 20:04

A few years back, I wrote some util library around DShow/DSound to let me play MP3s in a Windows C++ application. Is that still the normal way to do it in a C++/MFC app, or

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-31 20:40

    PlaySound() natively supports MP3 as long as it is embedded in a WAV file. People don't realize that WAV is a container format.

    Download the ffmpeg utilities to convert the header and preserve the codec:

    ffmpeg -i input.mp3 -c copy -f wav embedded_mp3.wav
    

提交回复
热议问题