As the title may suggest, I am trying to stitch together two sounds seamlessly. Please keep in mind I am a noob at scripting so there might be ((To some of the professionals out there.)) A lot of technical errors.
Using an audio editing program I made two 14 second long clips of a song. Now the hard part stitching them together on Roblox.
For the sake of simplicity I decided to create a simple click activated sound to test it. Script below.
function TheClick(playerWhoClicked)
script.Parent.Sound:Play()
end
script.Parent.ClickDetector.MouseClick:connect(TheClick)
Now that just plays one sound clip. I have modified it so it would play two sound clips one after the other.
function TheClick(playerWhoClicked)
script.Parent.Sound:Play()
wait(insert time here)
script.Parent.Sound:Play()
end
script.Parent.ClickDetector.MouseClick:connect(TheClick)
Now I thought it would be as simple as that, just insert the wait period the same length as the first audio clip.
However Roblox's definition of a second isn't the same as a second the editing program I used for the audio is. So there is a slightly noticeable stop. So I thought of a new way. Have second sound clip play once the first one has ended.
So the process in my mind goes like this, again for simplicity's sake the first sound clip will be called SoundA and the second SoundB.
Play SoundA, when SoundA is finished playing, Play SoundB.
This is where I reach the limit of my scripting knowledge, how to translate this into Lua. So this is where I ask for some help.
|