Jump to content


Play Sound in Loop


5 replies to this topic

#1 iceboylsg

    New Member

  • Members
  • PipPip
  • 21 posts

Posted 14 November 2009 - 07:15 AM

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.

#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 5305 posts
  • LocationBellevue, WA

Posted 14 November 2009 - 07:27 AM

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.
reedbeta.com - developer blog, OpenGL demos, and other projects

#3 iceboylsg

    New Member

  • Members
  • PipPip
  • 21 posts

Posted 14 November 2009 - 12:48 PM

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

#4 iceboylsg

    New Member

  • Members
  • PipPip
  • 21 posts

Posted 16 November 2009 - 07:49 AM

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

#5 iceboylsg

    New Member

  • Members
  • PipPip
  • 21 posts

Posted 17 November 2009 - 07:02 AM

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?

#6 Manuel Marino

    New Member

  • Members
  • PipPip
  • 14 posts

Posted 25 August 2010 - 08:39 PM

You have to wait exactly the lenght of the sound.
Read my latest Games articles: Shawn Sharp and Guild Wars 2
New Demos: Astronauts and Funk Music - Knights and Film Music
Music Composers love blondes! Why? Find here: Marino Sounds Studio





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users