Jump to content

View more

View more

Image of the Day

Inventory ! Va falloir trouver une autre couleur pour le cadre D: #AzTroScreenshot #screenshotsaturday https://t.co/PvxhGL7cOH
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

XAudio2 Loop wav file?

4: Adsense

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   

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


#2 Ashaman73   Members   

13714
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.