When I run this code I get a short grunt instead of full enunciation of the word "Copied". If I try it again immediately it will play the full wav file. If I wait 10 seconds and try again, it just gives me another grunt. What am I missing?
InitSound() ; Initialize Sound system
;UseOGGSoundDecoder() ; Use ogg files
; Loads a sound from a file
LoadSound(0,"C:\XferTemp\Copied.wav")
; Play sound
If IsSound(0)
PlaySound(0,0,100)
EndIf
Delay(1000)
FreeSound(0) ; The sound is freed
End
This is my wav file: https://www.hostize.com/v/DOkNyNmb7z
For some strange reason this site appends ".wav" onto the end of my wav file so you would need to adjust for that, along with whatever folder path you save it to.
NOTE: I used the free "PDFX.exe" from the window store to read the word "Copied" while recording it using the free "WavePad Audio Editor".
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
InitSound()
If LoadSound(0,"Copied.wav")
PlaySound(0,0,100)
Delay(1000)
FreeSound(0) ; The sound is freed
EndIf
I was testing in PBv6.21 also but Windows 11 so maybe a difference there. After applying a small modification based on Pjay's comment I got an acceptable result:
InitSound()
If LoadSound(0,"C:\XferTemp\Copied.wav")
PlaySound(0,0,0) ;Added this line
Delay(1000) ;And added this line
PlaySound(0,0,100)
Delay(1000)
FreeSound(0) ; The sound is freed
EndIf
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.