The resulting WAV file can be used with the API PlaySound().
Code:
' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ #compile exe "m2w.exe" #compiler pbcc ' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ FUNCTION PBmain as LONG cmd$ = command$ If cmd$ = "" Then StdOut $CRLF+"Input file must be an MP3 file, either on command line OR drag and drop of MP3 file" StdOut "Press any key ...." ! jmp bye End If If lcase$(right$(cmd$,4)) <> ".mp3" Then StdOut "File to convert must be an MP3 file" StdOut "Press any key ...." ! jmp bye End if bare$ = left$(cmd$,-4) outp$ = bare$+".wav" shell "ffmpeg -i "+cmd$+" -loglevel 0 -codec:a libmp3lame -q:a 9 -hide_banner xxxx.mp3" shell "ffmpeg -y -i xxxx.mp3 -c copy -f wav -hide_banner "+outp$ kill "xxxx.mp3" cls cln$ = "cmd /c dir "+bare$+".*" shell cln$ bye: waitkey$ End FUNCTION ' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
Comment