XAudio2 Loop wav file?

Started by
0 comments, last by Ashaman73 11 years, 9 months ago
how to loop in my wav file regarding the code below, only this step I need the wav file to be playing infinite


[color=#000080] //load a wave file
if( !buffer.load( "Audio\\mus0.wav" ) )
{
g_engine->Release();
CoUninitialize();
return -3;
}


//create the source voice, based on loaded wave format
if( FAILED( g_engine->CreateSourceVoice( &g_source, buffer.wf(),1 ) ) )
{
g_engine->Release();
CoUninitialize();
return -4;
}


//start consuming audio in the source voice
g_source->Start(1,0);

//play the sound
g_source->SubmitSourceBuffer( buffer.xaBuffer() );
Advertisement
You need to adjust the buffer and set the loop data, more informations about looping buffers: clicky

This topic is closed to new replies.

Advertisement