c++cwinapiwaveout

Play .wav with WaveOutOpen(C++)


I need to play audio file(.wav) with waveOutOpen function. I found manual for this. http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=4422&lngWId=3 but I dont know how change this for .wav files. Please help me...


Solution

  • You need mmioOpen, mmioRead functions to read payload data from .WAV file, and than you will be able to queue buffers using waveOut* API. If the data is PCM you can send it for playback directly, otherwise you might need to decompress using ACM API.

    You will fin great code snippets looking up mentioned API functions: