SourceFiles.org - Use the Source, Luke
Home | Register | News | Forums | Guide | MyLinks | Bookmark

Sponsored Links

Latest News
  General News
  Reviews
  Press Releases
  Software
  Hardware
  Security
  Tutorials
  Off Topic


Back to files

MPy3 - Python powered MP3 management system version 2.0
date 11/28/2001
author: ben wilson / ben@thelocust.org
home: http://mpy3.sourceforge.net

Table O' Contents
1 - Overview
2 - Requirements
3 - My Own Libraries
4 - 3rd Party stuff included
5 - INSTALLATION
6 - LINKS
7 - CONTACT
8 - TODO
9 - CHANGELOG

  1. OVERVIEW

What to say? MPy3 is a python-powered MP3 management system, aimed towards a mobile mp3 solution, though a standalone MP3 server is acceptable. It can use an LCD interface, with X and Curses (maybe) interface coming in the near future. It plays MP3s via xaudio, and you can even use LiRC, the Linux IR Control daemon with it too (i do!)

2. REQUIREMENTS

Requirements
Python 2.0 or greater (www.python.org)

I know it works with Python 2.0, and that is what I develop on, and there isn't any 2.0 functionality I use with it, so you shouldn't have any problems, though your mileage may vary.

rxaudio (www.xaudio.org)

        xaudio is an MP3 player, and rxaudio is the text interface to xaudio.  
        mpg123 (www.mpg123.com)would be used, but there isn't a mainstream 
        text-interface hack for it yet.  tk3play (http://www.ccmr.cornell.edu/~bef2/) 
        a tk-interface to mpg123 compiles (or attempts to, anyway) 'mpg123m', 
        a text interface to mpg123.  However, i have yet to get it to compile 
        correctly.  Newer distributions of mpg123 come with a small text file 
        mentioning this hack, and even includes a python script to control it, 
        but I haven't put much faith into it.  Get the mpg123 source, 
        it's the file in the 'tools' directory called 'interface-phython'.
        
        My development system is a Pentium-100 with 32 megs of RAM, and rxaudio
        runs just fine on it.  You shouldn't have any problems.

##

3. MY OWN LIBRARIES

pyrx.py (mpy3.thelocust.org/mpy3.sourceforge.net)

        A library I wrote to handle rxaudio.  It's pretty damned handy, if you
        ask me, but I did write it after all.  Anyway, it's released under the LGPL,
        and you can use it for your own means.  (Just let me know, m'kay?).
        It is pretty well documented, and should be easy to implement.  Check out the
        source.

pymix.py (mpy3.sourceforge.net)

        A library to control aumix.  Currently, it doesn't control EVERYTHING 
        aumix handles, but it does it most of the stuff (vol, treb, bass, pcm,
        cd, muting, etc).  Again, it's LGPL'd, lemme know if you use it. It is 
        pretty well documented, and should be easy to implement.

pyCFontz.py (mpy3.sourceforge.net)

        A library to handle a CrystalFontz serial LCDs.  Thanks to CrystalFontz's
        (www.crystalfontz.com) excellent documentation and bad-ass LCD's, I've been
        able to write a Python library for it.  Everything you see displayed on your
        LCD is done through this library.  All of the functions that the LCD handles 
        are taken care of in this library. See the source for documentation.

pyLCDemu.py (mpy3.sourceforge.net)

        A library that emulates the functions and functionalities of pyCFontz, so if you
        don't have the LCD hangin' around (like I didn't for a while), this works just as
        well.  I guess you could also use it on a TV out, if that is your bag. handy!

pyttyinput.py (mpy3.sourceforge.net)

        get input from the console, essentially.  it grabs characters in streaming fashion.  woo-wee!
        again, you could use this library in other projects that need this sort of input.

pyjoyinput.py (mpy3.sourceforge.net)

        the mystical joystick input library.  this is still in extreme beta, but it will get fleshed out
        in 2.1 methinks.  using the mpy3.conf file, you will be able to specify what each control on the
        joystick sends.  up = 8, down = 2, etc.  you get the idea.  again.  HANDY.

pyplaylist.py (mpy3.sourceforge.net)

        a simple mp3 playlist script i have written.  next, previous, randomize.  It
        gets tags via the mp3infor.py script mentioned earlier.

##

4. 3RD PARTY LIBRARIES

mp3infor.py (http://www.crosswinds.net/~trazor/)

        pyplaylist.py, my list management library requires and uses mp3infor.py,
        a library written by Eduardo Roldan, and is released under the GPL.  
        (though, something tells me it should be under the LGPL, which covers
        libraries).  Anywho, I may write my own in the future, and include it
        with listmp3.py, but mp3infor.py gets the job done.  A filereader is 
        a filereader just the same.  NOTE: this is INCLUDED with MPy3 with no modifications from me.

wxPython (http://www.wxpython.org)

        a replacement for Tk that is very wonderful and great.  You need this for the X part of the package, 
        and ONLY if you need pyLCDemu.py 

##

5. INSTALLATION -

Ungzip/tar, edit the mpy3.conf file, and run ./mpy3.py ... piece of pie.

##

6. LINKS

        CAJUN (http://cajun.sourceforge.net) 
        Car Audio Jukebox Using uNix
        - part of the reason why i did this, and the main reason why i built my
        - own carmp3 box

        Perl (http://www.perl.org)
        - another part of why i did this.  Cajun is written in this stuff.  God,
        - Perl is hard to read

        Python (http://www.python.org)
        - a BIG reason why I started doing this.  I didn't know Python beforehand,
        - and I thought I'd give it a shot.  Damn.  Me Grimlock LOVE Python.  Give
        - it a shot.  It's not as robust as Perl, but it is MUCH easier to learn and
        - love (IMHO).  cat perlflames > /dev/null

        theLocust's CAJUN (http://cajun.thelocust.org)
        - my own car mp3 project... lots of pictures, information, though it hasn't been
        - updated in a while, though, along with the CAJUN site, a good place to start.

##

7. CONTACT

        I would SO love to hear from anyone who uses/hacks this beast.  I tried my
        best to document it as well as I could, and combined with Python's ease of 
        readability, go for it!  If you've never given Python a shot, try it with
        this, or anything really.  BTW, O'Reilly's Learning Python book is excellent.
        Though, experienced hackers may want to get Programming Python by O'Reilly.
        I went through Learning Python in about a week.

        ben wilson - ben@thelocust.org / thelocust@users.sourceforge.net
        MPy3 Home - http://mpy3.sourceforge.net
        MPy3 Project - http://sourceforge.net/projects/mpy3 

##

8. TODO

        v2.1 - 
        Matrix Orbital/HDD44780 (whatever) LCD support
        Joystick control (possibly)

        More in-depth information about using COAR (http://www4.infi.net/~cpinkham/cajun/)
                as the read-only RAMDISK tool that works so well with CAJUN.  Shouldn't be 
                too hard.  Just haven't gotten to it.

        CD-ROM playing support, MP3 CD support too.

        Saving playlists on non-readonly systems.

        v2.2 - who knows!

##
9. CHANGELOG

        v2.0 - 
          - threading!  plenty of it.  no more lag on keypress
          - playlisting.  recursive, selective, etc.  very cool. 
          - if you are in any state other than "play", then after a defined number of seconds, it reverts
          . back to state_play, like a REAL cd player.  shocking!
          - removed "global" keys, with the exception of the shutdown, menu, and help keys.  combined with
          . the "return to state_play" functionality, this should still be okay.  
          - various updates to mpy3.conf
            - default key mapping is for the number pad.  should work well in most cases, especially for
            . people using numeric remote controls
            - MPy3 now respects the display_type config option.  either lcdemu or crystalfontz at the moment.

          - updates to pyplaylist.py (renamed from listmp3.py
            - upon load of pyplaylist, all songs under the directory are added to a "master list"
            . then the "playlist" references indexes in the "master list".  this way, scanning of 
            . the drive is kept to a minimum.  
            - making new playlists are handled now
            . note the add_to_templist functions, etc.

          - updates to pyrx.py
            . faster retrieval of information.  check out the threading in mpy3.py -- this makes the
            . updates very fast.  also tweaked the select.select statement to make it a non-blocking
            . poll.

          - updates to pyttyinput.py (previously ensconsed within mpy3.py
            . faster retrieval of information, non-blocking poll, etc.
            . again, check the threading in mpy3.py -- quick like wind!

          - pyLCDemu.py added 
            . initial addition of the emulator

          - updates to pyCFontz.py
            . blankline() added - allows for a blank line to be written to the LCD
            . because the line() function strips off spaces
        Matrix Orbital/HDD44780 (whatever) LCD support
        Joystick control (possibly)

        More in-depth information about using COAR (http://www4.infi.net/~cpinkham/cajun/)
                as the read-only RAMDISK tool that works so well with CAJUN.  Shouldn't be 
                too hard.  Just haven't gotten to it.

        CD-ROM playing support, MP3 CD support too.

        Saving playlists on non-readonly systems.

        v1.0 
          - initial release

##


Sponsored Links

Discussion Groups
  Beginners
  Distributions
  Networking / Security
  Software
  PDAs

About | FAQ | Privacy | Awards | Contact
Comments to the webmaster are welcome.
Copyright 2006 Sourcefiles.org All rights reserved.