Re: Playing several songs together or one after another
Status: Alpha
Brought to you by:
cwalther
From: Christian W. <cwa...@gm...> - 2009-02-07 13:26:37
|
chikitin wrote: > Hi, Assume we have three sound define in a node as follows; local > sound1= sound '.../sound1.ogg" local sound2= sound '.../sound2.ogg" > local sound3= sound '.../sound3.ogg" 1. How is that possible to play all > the sounds: sound1, sound2, and sound 3 together? This code doesn't > work: sound {sound1,sound2,sound3}. Is this code right? sound1:play() > sound2:play() sound3:play() Yes, that should work. It might not be accurate enough if you require the sounds to overlap exactly, but I'd expect the differences to be on the order of microseconds. > 2. How can I play one sound after another, like a play list? should we > use the pipmak schedule to trigger say sound2 after sound 1 is played? Yes, exactly. Unfortunately, this is not accurate enough for seamless concatenation of the sounds - you'll have an unpredictable gap of several milliseconds. Seamless concatenation is just not possible at the moment. > and if so, how do you define the interval for the pipmak.schedule? In the current development version of Pipmak, sounds have a duration() method that you can use for that purpose. In Pipmak 0.2.7, your only option is determining the duration of your sounds beforehand and hardcoding it in your script. > I tried to give the exact length ( in miliseconds) in the interval > schedule, but it plays sound2 very early and it overlaps with sound1. pipmak.schedule() takes seconds, not milliseconds. -Christian PS: If you intend to continue to post on this mailing list, you're invited to subscribe. The advantage for you is that your posts appear on the list immediately, and the advantage for me is that I don't have to approve all of your posts manually (the moderation requirement for non-subscribers is just to keep the spam out). You can turn off e-mail delivery in your subscription options if you prefer to read the list on Nabble. |