Page 1 of 1

How to play MP3 under Linux ?

Posted: Mon Jun 21, 2004 1:05 pm
by Rings
anyone knows a way to play MP3' with purebasic under a linux-system ?
I don't need all functions that for example FMOD offers,only a subset to play/pause is needed (and when the mp3 stops playing ) .
under Windows you can play MP3 with the Movie-Lib or over the SendMessage/Winmm.dll way.
anyone know how to do such under linux ?
please no hints only, Code or solution-links are required :)

Posted: Mon Jun 21, 2004 2:16 pm
by Saboteur
Two questions...
A front-end to mpg123 could help you? You really want a pause key?

Posted: Mon Jun 21, 2004 6:25 pm
by Rings
yes, a Pause Key is a must.
i can live wit a 'remote-tool' but i'm sure that there must exists a sdl or similar on the linux platform.

Posted: Tue Jun 22, 2004 10:56 am
by Saboteur
Yes! I remember now. With smpeg library you can play any video or sound. I did a little video player in C++, and you can do play, pause, stop, etc, but I think it's not difficult translate to purebasic.
I'm at work now, but I'll try to find it later, at home.

Posted: Wed Jun 30, 2004 11:37 pm
by Saboteur
Sorry Rings, I have a little problem with my Linux disk and I can't try this program.
You need libsmpeg library, and you can play, pause and stop music.
Please, try it and tell if it works.

Code: Select all

  #NULL=0
  #TRUE=1

  #STOPPED=0
  #PAUSED=1
  #PLAYING=2

  status.l=#STOPPED
  song.l=0

  If OpenWindow(0, 200, 200, 200, 90, #PB_Window_SystemMenu, "Rings Player")
    If CreateGadgetList(WindowID(0))
      ButtonGadget(0,10,40,50,30,"Play")
      ButtonGadget(1,60,40,50,30,"Pause")
      ButtonGadget(2,120,40,50,30,"Stop")
    EndIf
  EndIf

  OpenLibrary(0, "/usr/lib/libsmpeg.so")
  ; place here your favorite MP3
  song=callfunction(0, "SMPEG_new", "musica.mp3", #NULL, #TRUE)

  Repeat
    EventID.l = WaitWindowEvent()
    GadgetID.l = EventGadgetID()

    Select EventID
      case #PB_Event_CloseWindow
        Quit = 1
      case #PB_Event_Gadget
        Select GadgetID
          case 0
            If status<>#PLAYING
              CallFunction(0, "SMPEG_play", song)
              status=#PLAYING
            EndIf
          case 1
            If status=#PLAYING
              CallFunction(0, "SMPEG_pause", song)
              status=#PAUSED
            EndIf
          case 2
            CallFunction(0, "SMPEG_stop", song)
            status=#STOPPED
        EndSelect
    EndSelect

  Until Quit = 1

  CallFunction(0,"SMPEG_delete",song)
  CloseLibrary(0)

End

Posted: Thu Jul 01, 2004 10:44 am
by Rings
Danilo post me that it worked very well under SUSE 9.1 now.
So next is time to port my mp3-player....
thx very much

Posted: Thu Jul 01, 2004 2:00 pm
by Saboteur
:D Ok.
First... Rings MP3 player
Next... Rings video player
;) :lol:

Posted: Thu Jul 01, 2004 3:29 pm
by Rings
Saboteur wrote::D Ok.
First... Rings MP3 player
Next... Rings video player
;) :lol:
no ->Frederic can port his MOVIE-Lib ;)

Posted: Fri Jul 02, 2004 5:13 pm
by Fred
does this library support video ?

Posted: Wed Jul 14, 2004 6:58 pm
by Beach
I was able to get my MP3 to play on Mandrake 9.2 using version 3.91 of PB and by tweaking the library to: /usr/lib/libsmpeg-0.4.so.0 :D Very cool!

How would I go about finding more functions from this library?

Posted: Wed Jul 14, 2004 7:05 pm
by thefool
I searched google for the lib and found this:
SMPEG (SDL MPEG Player Library) is a free MPEG1 video player library with sound support. Video playback is based on the ubiquitous Berkeley MPEG player, mpeg_play v2.2. Audio is played through a slightly modified mpegsound library, part of splay v0.8.2. SMPEG supports MPEG audio (MP3), MPEG-1 video, and MPEG system streams.
so fred, it seems that it can play movies and beach, the site i found this info on is http://packages.debian.org/testing/libd ... bsmpeg-dev

But notice i havent tested it, just found info on the net

Posted: Wed Jul 14, 2004 9:00 pm
by Saboteur
This library uses SDL and is possible play videos with sound. I did a little player in C++ and is very easy, showing video in a SDL surface.

Posted: Sun Jun 07, 2009 8:26 pm
by pbprog
help call all command in purebasic :(

This original and smpeg
http://svn.icculus.org/smpeg/trunk/play ... iew=markup


dll like this one with the same commands!
http://docs.taoframework.com/Tao.Sdl/Ta ... _Info.html


smpeg.h for help call command!

http://www.koders.com/c/fid1BF7CB7C2C1B ... E7A3A.aspx



I call these commands as well as play stop and pause

I would take the total time, current time and other controls!

how do I get them in purebasic?