put several sounds

Post your Gambas programming questions here.
Post Reply
Kanba
Posts: 2
Joined: Wednesday 25th November 2020 2:37pm

put several sounds

Post by Kanba »

Hello everyone, I am creating software that needs to play several sounds, but independently, as it will be the user who will put them to play. I already made these codes, is there any way to do this or not?
thank you for your help!
Image
Image
User avatar
cogier
Site Admin
Posts: 1125
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: put several sounds

Post by cogier »

Hi kanba and welcome to the forum.

Try this code: -
''Needs gb.sdl2.audio

Public Sub Form_Open()

  Dim sSound1 As Sound = Sound.Load("16.wav") 'Change as necessary
  Dim sSound2 As Sound = Sound.Load("20.wav") 'Change as necessary

  Channels[1].Play(sSound1)
  Channels[2].Play(sSound2)

End
Kanba
Posts: 2
Joined: Wednesday 25th November 2020 2:37pm

Re: put several sounds

Post by Kanba »

Thanks! worked perfectly!
Post Reply