put several sounds

Post

Posted
Rating:
#1 (In Topic #504)
Trainee
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!
<IMG src="https://i.imgur.com/x8QKnuL.png"> </IMG>
<IMG src="https://i.imgur.com/CS8dCvD.png"> </IMG>
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Guru
cogier is in the usergroup ‘Guru’
Hi kanba and welcome to the forum.

Try this code: -

Code (gambas)

  1. ''Needs gb.sdl2.audio
  2.  
  3. Public Sub Form_Open()
  4.  
  5.   Dim sSound1 As Sound = Sound.Load("16.wav") 'Change as necessary
  6.   Dim sSound2 As Sound = Sound.Load("20.wav") 'Change as necessary
  7.  
  8.   Channels[1].Play(sSound1)
  9.   Channels[2].Play(sSound2)
  10.  
  11.  
Online now: No Back to the top

Post

Posted
Rating:
#3
Trainee
Thanks! worked perfectly!
Online now: No Back to the top
1 guest and 0 members have just viewed this.