Help! How to set a channel for sound with the new win7 code
Posted: Tue Dec 21, 2010 11:32 pm
Now that GM gave us the code shown below, I haven't been able to figure out how to select a specific channel. This is necessary for some of my games because I need specific control when the sound is played and with other sounds. If anyone knows or can figure out how to specify a channel, please let the rest of us who need it know! Pleeeeeassse!
- Code: Select all
sub PlaySoundWin7(SoundFile, NumRepeat)
If Action.IsComponentInstalled("NSPlay.NSPlayCtl.1") = False Then
MsgBox "Unable to find the media player component.", vbCritical, "Error"
Else
If Action.DoesComponentExist("MediaPlayer1") = false Then
AddComponent "NSPlay.NSPlayCtl.1", "MediaPlayer1"
End If
Component("MediaPlayer1").Object.FileName = SoundFile '(replace with your file)
Component("MediaPlayer1").Object.PlayCount = NumRepeat
Component("MediaPlayer1").Object.Play
End If
End Sub
- Code: Select all
sub StopSoundWin7()
Component("MediaPlayer1").Object.Stop
End Sub