Play Sound in Loop

47ac448f6d4fedf29eea76b6e82d47df
0
iceboylsg 101 Nov 14, 2009 at 07:15

guys, i ‘m doing the artoolkit marker detection. i try to play the sound using openAL when the marker is detected. But i have a prob, the sound i put in the loop, it keep repeating the sound in very high speed. It means it have’t finnish to play it , then it replay again. Did the openAL has the function to play the sound until it finish? and it won’t restart even the play function is called.

5 Replies

Please log in or register to post a reply.

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 167 Nov 14, 2009 at 07:27

Like I explained in your last thread, you have to play the sound once then wait until it’s finished. Don’t try to play the sound multiple times or it will repeat as you described.

47ac448f6d4fedf29eea76b6e82d47df
0
iceboylsg 101 Nov 14, 2009 at 12:48

hmm…i know there is a method using sleep9) to generate the time for the sound to to play until finish. But it is not a good method. And i can’t find any function in AL related to this..Hazz…

47ac448f6d4fedf29eea76b6e82d47df
0
iceboylsg 101 Nov 16, 2009 at 07:49

hey, if i don’t want it to replay after the playsouce function,how should i write the code?..i stuck here=.=

47ac448f6d4fedf29eea76b6e82d47df
0
iceboylsg 101 Nov 17, 2009 at 07:02

reeta, how do i change the alsourceplay function? cos i don’t wan it to replay after i call the alsourceplay function again. or do u have any idea how to do it?

9fb57988ee2aa7efeafc3bfb4063c641
0
Manuel_Marino 101 Aug 25, 2010 at 20:39

You have to wait exactly the lenght of the sound.