Can't play audio file on Windows 10

Asked by Neil

Hi, I'm having trouble playing an audio file from Sikuli IDE. I'm on Windows 10.

I've tried opening Windows Media player using PowerShell - there is no error, but media player does not open, and no sound plays.
The script was verified in PowerShell and I'm using the multiline snippet example from the Sikuli docs.

Also tried opening Sikuli from an elevated command prompt, in case it's a permissions issue.

I've even tried the example for playing a beep from the java toolkit - again, no error but no sound.
Please help!

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Neil
Solved:
Last query:
Last reply:
Revision history for this message
Dirk (gugelhupf13) said :
#1

Wie sieht deine Anweisung hierzu aus?

Ich nutze diese Zeile:

openApp("C:\\Windows\\Media\\Alarm01.wav")

Revision history for this message
Neil (morrissn) said :
#2

Thank you. Your code put me on the right direction.

This is what eventually worked for me:
wmPlayer = App("C:\\Program Files\\Windows Media Player\\wmplayer.exe")
# path to wav file - note, must be under the folder where Sikuli jar is running from
filePath = "C:\\Sikuli\\audiofiles\\Test.wav"
# pass filePath as a parameter when opening App
wmPlayer.setUsing(filePath)
wmPlayer.open()