Jump to content
Sign in to follow this  
yeto

Why won't this .wav file play using the SoundPlay function?

Recommended Posts

If Not @error Then
    SoundPlay (@WindowsDir & "Computer_Magic-10sec.wav", 1)
        EndIf

The Beep function works fine but when I replace the Beep function with the SoundPlay function it does not play the wav file. The wav file is located on my computer hard drive. Any thoughts as to what I could be doing incorrectly?

Thank you,
yeto

Share this post


Link to post
Share on other sites
4 hours ago, 1957classic said:

You're missing a backslash.

 

If Not @error Then
    SoundPlay (@WindowsDir & "\Computer_Magic-10sec.wav", 1)
        EndIf

 

I tried that and it still won't play. I also changed the code to the full path and still no audio.

If Not @error Then
    SoundPlay (@WindowsDir & "C:\Users\?????\Desktop\MP3s & WAV\Computer_Magic-10sec.wav", 1)
        EndIf

Could it be that the script needs to loop or continue or something for the wav file to play? I also changed from SoundPlay to Beep and set Beep for 5 seconds and the Beep worked fine and lasted for the full 5 seconds.

Edited by yeto

Share this post


Link to post
Share on other sites
5 hours ago, 1957classic said:
@WindowsDir = C:\Windows

Where is the wav file located? Is it in the Windows Directory or on the Desktop?

It is on my desktop.

Share this post


Link to post
Share on other sites
4 hours ago, FrancescoDiMuro said:

So why do you use @WindowsDir which clearly refers to the Windows Directory instead of @DesktopDir which clearly refers to the Desktop Dir? :)

Honestly, because I don't know what the H@!! I am doing. I am trying to learn though. The SciTE Soundplay help file example said to use @WindowsDir. 

Thank you for taking time to reply. This is very helpful.

Kind regards,
yeto

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...