This shows you the differences between two versions of the page.
playing_20an_20mp3_20file_20_28lbb_29 [2018/03/31 13:19] 127.0.0.1 external edit |
playing_20an_20mp3_20file_20_28lbb_29 [2018/04/17 18:14] (current) tbest3112 Added syntax highlighting |
||
---|---|---|---|
Line 2: | Line 2: | ||
//by Richard Russell, January 2016//\\ \\ This is a very simple, no-frills, way of playing an MP3 file:\\ \\ | //by Richard Russell, January 2016//\\ \\ This is a very simple, no-frills, way of playing an MP3 file:\\ \\ | ||
+ | <code lb> | ||
mp3file$ = "C:\users\richard\music\Saint_Saens-Organ.mp3" | mp3file$ = "C:\users\richard\music\Saint_Saens-Organ.mp3" | ||
ret$ = space$(128) + chr$(0) | ret$ = space$(128) + chr$(0) | ||
Line 8: | Line 9: | ||
cmd$ = "play music" | cmd$ = "play music" | ||
calldll #winmm, "mciSendStringA", cmd$ as ptr, ret$ as ptr, 128 as long, 0 as long, r as long | 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:\\ \\ | \\ If you want the MP3 file to be played repeatedly you can change the play command to:\\ \\ | ||
+ | <code lb> | ||
cmd$ = "play music repeat" | cmd$ = "play music repeat" | ||
+ | </code> |