on Sep 17th, 2015, 9:34pm, mattlp1980 wrote:Looking to create an Mp3 shuffle player |
|
Here's a very simple MP3 player. Hopefully you can achieve most of what you want by means of other MCI commands, there's a list at MSDN.
Code: filedialog "Select an MP3 file", "*.mp3", mp3file$
if mp3file$ = "" then end
ret$ = mciSendString$("open " + chr$(34) + mp3file$ + chr$(34) + _
" type mpegvideo alias music")
ret$ = mciSendString$("play music")
if ret$ = "" then print "Playing "; mp3file$
end
function mciSendString$(s$)
buffer$ = space$(1024)+chr$(0)
buflen = len(buffer$)
calldll #winmm, "mciSendStringA", s$ as ptr, buffer$ as ptr,_
buflen as long, 0 as long, ret as short
if ret then
mciSendString$ = "error ";ret
else
mciSendString$ = trim$(buffer$)
end if
end function
Richard.