Playing+an+MP3+file+(LBB)

//by Richard Russell, January 2016//

This is a very simple, no-frills, way of playing an MP3 file:

code format="lb" mp3file$ = "C:\users\richard\music\Saint_Saens-Organ.mp3" ret$ = space$(128) + chr$(0) cmd$ = "open " + chr$(34) + mp3file$ + chr$(34) + " type mpegvideo alias music" calldll #winmm, "mciSendStringA", cmd$ as ptr, ret$ as ptr, 128 as long, 0 as long, r as long cmd$ = "play music" calldll #winmm, "mciSendStringA", cmd$ as ptr, ret$ as ptr, 128 as long, 0 as long, r as long code

If you want the MP3 file to be played repeatedly you can change the play command to:

code format="lb" cmd$ = "play music repeat" code