how to loop in my wav file regarding the code below, only this step I need the wav file to be playing infinite,
Members - Reputation: 123
Posted 02 July 2012 - 07:48 AM
//load a wave file
if( !buffer.load( "Audio\\mus0.wav" ) )
//create the source voice, based on loaded wave format
if( FAILED( g_engine->CreateSourceVoice( &g_source, buffer.wf(),1 ) ) )
//start consuming audio in the source voice
//play the sound
g_source->SubmitSourceBuffer( buffer.xaBuffer() );
Members - Reputation: 398
Posted 03 July 2012 - 12:09 PM
// Set the sound to loop over it's entirety. buffer.xaBuffer().LoopBegin = 0; buffer.xaBuffer().LoopLength = 0; buffer.xaBuffer().LoopCount = XAUDIO2_LOOP_INFINITE; //play the sound g_source->SubmitSourceBuffer( buffer.xaBuffer() );
Hope that helps.
[Edit] Please use code tags rather than coloured text, it's a nightmare to reply
Edited by Telios, 03 July 2012 - 12:10 PM.