複数の音声ファイルを連続して再生したい

Hello.

I want to play multiple audio files consecutively.
The code below plays them almost simultaneously.

Var srcFileA As FolderItem
Var srcFileB As FolderItem

srcFileA = SpecialFolder.Desktop.Child(“a.mp3”)
If srcFileA <> Nil And srcFileA.Exists Then
Var s As Sound
s = srcFileA.OpenAsSound
s.Play
End If

srcFileB = SpecialFolder.Desktop.Child(“b.mp3”)
If srcFileB <> Nil And srcFileB.Exists Then
Var s As Sound
s = srcFileB.OpenAsSound
s.Play
End If

What is the best way to play b.mp3 after a.mp3?
Could you please tell me?

First, give the two sources a separate Sound Property–let’s just say Sound1 and Sound2. Then, hold Sound2 in a timer until Sound1.IsPlaying=False

Edit: thinking it through a little more, you can do it with your single “s” Sound property :slight_smile:

Thank you.
I created a sample based on the hints you gave me.
It worked.

Thank you.
arigato gozaimasita.

testSoundPlay.zip (4.0 KB)

Thank you. I will check it out.

If you want a larger playlist that two, you could try putting your source folderitems into an array, and looping through them.