Jump to content

  • Log In with Google      Sign In   
  • Create Account

Calling all IT Pros from Canada and Australia.. we need your help! Support our site by taking a quick sponsored surveyand win a chance at a $50 Amazon gift card. Click here to get started!


XAudio2 Loop wav file?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Aguia   Members   -  Reputation: 123

Like
0Likes
Like

Posted 02 July 2012 - 07:48 AM

how to loop in my wav file regarding the code below, only this step I need the wav file to be playing infinite


//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() );


Sponsor:

#2 Ashaman73   Crossbones+   -  Reputation: 11916

Like
0Likes
Like

Posted 03 July 2012 - 03:34 AM

You need to adjust the buffer and set the loop data, more informations about looping buffers: clicky

Ashaman

 

Gnoblins: Website - Facebook - Twitter - Youtube - Steam Greenlit - IndieDB - Gamedev Log





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS