PlayMp3 Error

Started by pguild, May 25, 2019, 12:41:25 PM

Previous topic - Next topic

pguild

;This script fails:
filename = "C:\Users\Administrator\Downloads\TTS-mp3\mp3-error.mp3"
donotwait = 1
PlayMidi( filename, donotwait)
RETURN

I get an error message suggesting that the file may be corrupt or the necessary support files are not present.

Windows 10 plays the file just fine when I paste the pathname into the "Type here to search" box at lower left.
You may want to check out this video to see for yourself:

https://www.loom.com/share/350fbbb5304044638431f89bda5b726f
www.DogTrainingPsychology.com -- "Don't wish it were easier, wish you were better."  as aphorism by Jim Rohn as quoted in the Kindle Book, GEMS OF WISDOM by Philip Seyer

pguild

I see that I am trying to use the PlayMidi function to play an MP3 file -- of course -- that doesn't work.
I was able to play an mp3 file like this:

filename = "C:\Users\Administrator\Downloads\TTS-mp3\Affirmations-1558810514_5ce98f9240800.mp3"
;filename = "C:\Users\Administrator\Downloads\TTS-mp3\mp3-error.mp3"
donotwait = 1
;shellexecute(filename, "", "", @ZOOMED,"")
;pause("runshell",filename)
runshell( filename,"", "", @ICON, @NOWAIT)

The challenge, now, is that @ICON specification does not iconize the application playing the MP3 file.
www.DogTrainingPsychology.com -- "Don't wish it were easier, wish you were better."  as aphorism by Jim Rohn as quoted in the Kindle Book, GEMS OF WISDOM by Philip Seyer

td

WinBatch passes the starting window state to the application as part of a call to the CreateProcess Win32 API function.  Most applications honor the request but an application doesn't necessarily have to.  It is up to the application's developer to determine how it responds to the request.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade