Hi guys,

I'm making up a pong game and I'm having trouble with the sounds. I want to be able to play a sound everytime the ball hits a wall. I'm using the following code:

If BallX < 0 Then
BallX = 0
BallXDir = 1
RtnValue = sndPlaySound(Bounce, SND_ASYNC Or SND_MEMORY)

The sound has been stored here:

Dim Buffer As String
Dim F As Integer
Dim SoundBuffer As String
On Error GoTo NoiseGet_Error
Buffer = Space(1024)
SoundBuffer = ""
F = FreeFile
Open FileName For Binary As F
Do While Not EOF(F)
Get #F, , Buffer
SoundBuffer = SoundBuffer & Buffer
Loop
Close F
StoreSound = Trim(SoundBuffer)
Exit Function
NoiseGet_Error:
SoundBuffer = ""
Exit Function

And in the form load:
Bounce = StoreSound(App.Path + "Bounce.wav")

I think I've declared everything I should:

Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Private Const SND_ASYNC = &H1
Private Const SND_SYNC = &H0
Private Const SND_MEMORY = &H4


But the sound won't play. Can you see where I might have gone wrong? Maybe I left something out.

Thanks.