How to play ogg vorbis file using waveout APIs with vorbis.acm installed.

Discussion in 'Windows Vista Music, Pictures and Video' started by user471, Jul 5, 2011.

  1. user471

    user471

    Joined:
    Jun 25, 2011
    Messages:
    4
    Likes Received:
    0
    Hi,

    I installed the vorbis.acm codec and tried to play the ogg file using waveout APIs. The return value for waveOutPrepareHeader(), waveOutWrite() and waveOutUnprepareHeader is 0(success) only but the sound is not playing.

    I set the waveformatex structure as follows.

    WAVEFORMATEX waveform;

    waveform.wFormatTag = WAVE_FORMAT_VORBIS2;

    waveform.nChannels = 2;

    waveform.nSamplesPerSec = 22050;

    waveform.wBitsPerSample = 16;

    waveform.cbSize = 0;

    waveform.nBlockAlign = (waveform.nChannels * waveform.wBitsPerSample)/8;

    waveform.nAvgBytesPerSec = 8000;

    I set the wavehdr structure as follows.

    WaveHeader.lpData=buffer;

    WaveHeader.dwBufferLength=4080;

    WaveHeader.dwFlags=0;

    WaveHeader.dwLoops=0;

    Can anybody please suggest what is the problem with my settings?

    Thanks.
     
    Last edited: Jul 5, 2011
    user471, Jul 5, 2011
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.