User Tools

Site Tools


playing_20an_20mp3_20file

This is an old revision of the document!


Playing an MP3 file

by Richard Russell, May 2015

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

      mp3file% = OPENIN("*.mp3")
      IF mp3file% = 0 THEN QUIT
      CLOSE #mp3file%
      mp3file$ = $$!420
      PROCmci("open """ + mp3file$ + """ type mpegvideo alias music")
      PROCmci("play music")
      END
      DEF PROCmci(cmd$)
      LOCAL R%, S%
      DIM R% LOCAL 128
      SYS "mciSendString", cmd$, R%, 128, 0 TO S%
      IF S% ERROR 100, "mciSendString failed: " + STR$(S%)
      ENDPROC


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

      PROCmci("play music repeat")
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information
playing_20an_20mp3_20file.1522502373.txt.gz · Last modified: 2018/03/31 13:19 by 127.0.0.1