LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   mp3 jukebox idea (different idea then I have seen) (http://www.linuxquestions.org/questions/linux-software-2/mp3-jukebox-idea-different-idea-then-i-have-seen-428818/)

supradrvr 03-26-2006 10:16 PM

mp3 jukebox idea (different idea then I have seen)
 
Ok here is my idea. I have an old jukebox chasis that played 45's. It is no longer fixable and I bought another to replace it. Here is my plan but I cant seem to find the way to do it. I want to use a pc with linux and an lcd display to display songs and artist but here is the part I cant figure out. I want it to work like a "real jukebox". In other words, lets say I have a songs file name set to 100.mp3, but the id3 tag has a real artist and song title for the display, if you hit 100 then # (# actually presses enter key) on the keypad it executes a script that plays song 100.mp3 but then also be able to input other numbers that will call up more songs after it has finished. I have done a lot of searching but I dont find anything that is quite what I want. If any one has any input I would be greatful. Thanks

mickyg 03-27-2006 03:27 AM

Are you asking for software suggestions, or programming suggestions? What have you found when you've been searching?

ethics 03-27-2006 04:21 AM

On a very basic level (i'm not a software developer) and just wondering how i'd tackle this problem.

I'd use cplay or a similar CLI media player, hopefully one that can read from text files.

You could make alias' for each song (long winded, you could make a script that easilly added the alias line including specified file/artist etc.)

so you'd have alias

Code:

alias 100="cplay song.ogg"
And so on for all your songs. That way you can type your number, hit enter in the shell and have it execute the command and play the file. You could also have something a bit cuter to list the files for the user to browse through. Now for playlists and such you can write a script called playlist or something (scripting isn't my strongest point :P) that takes your number/s, finds it in the alias list strips the file out and appends it to a text file (or .pls or whatever), once it returns false for checking new input (your song numbers) it goes ahead and runs the media player with that text file as input (or give the option to save the file).

Anyway that's REALLY basic off the top of my head but can't see anything impossible in there

zidane_tribal 03-27-2006 07:51 AM

shell scripts to the rescue!
 
Quote:

Originally Posted by supradrvr
Ok here is my idea. I have an old jukebox chasis that played 45's. It is no longer fixable and I bought another to replace it. Here is my plan but I cant seem to find the way to do it. I want to use a pc with linux and an lcd display to display songs and artist but here is the part I cant figure out. I want it to work like a "real jukebox". In other words, lets say I have a songs file name set to 100.mp3, but the id3 tag has a real artist and song title for the display, if you hit 100 then # (# actually presses enter key) on the keypad it executes a script that plays song 100.mp3 but then also be able to input other numbers that will call up more songs after it has finished. I have done a lot of searching but I dont find anything that is quite what I want. If any one has any input I would be greatful. Thanks


now, as i understand, you want it to work like a real jukebox, yes? so you basicly punch in the numbers, and the jukebox will queue them and play them sequentially in the order you typed them in? and your basic setup so far is that you have a list of songs called 1.mp3, 2.mp3, 3.mp3 etc.

you can create a shell script to do this, to read the input number with 'read' (a command built in to bash), add .mp3 on the end, then pass the filename to an mp3 player like mpg123, and an mp3 tag reader like tagmp3 to read the tags and pass them to your display. that will enable your shell script to run in the foreground, and accept all the input, and control the mp3 player and display in the background.

if your not sure about writing a shell script to do this, then by all means give me a nudge, it sounds quite interesting.

oh, and if you need any help with the hardware side of things (mounting the pc, any physical building help) then try checking out http://www.bit-tech.net/, its a 'modders' site i hang out on, people who put pc's in various things, mod their cases, etc. nice people, and no doubt they would love a project like this.

supradrvr 03-27-2006 02:26 PM

zidane_tribal you hit the nail right on the head. I just did not know exactly how to make the scripts. I have the pc parts already thats not a problem. do you think you could give an example of the shell script, something to get me started? Thanks everyone for the responces.

zidane_tribal 03-27-2006 06:10 PM

sure thing, lemme poke it, its stupid'o'clock here now and its been an insane day at work, im gonna hit the hay and i'll have a tinker in the morning when its quiet, see if i can come up with something easy for you :)

supradrvr 03-27-2006 06:45 PM

Typical Monday for me too. No big hurry, take your time. Thanks

michaelk 03-27-2006 07:22 PM

So what kind of budget do you have for this project?
You can use a LCD display with a serial port interface and a PS/2 keypad for data input. I see this simple script now becoming a c program. If you want a more professional keypad of sorts you can build one that uses the parallel port. Hopefully your intended Motherboard still has some legacy stuff. USB would complicate things a touch.

supradrvr 03-27-2006 08:58 PM

My design was to use a 40x2 lcd display and interface either serial or parallel, a PII/PIII mobo with 450 mhz and 128-256 meg ram. I plan to "hack a keyboard" and interface it with the keypad that exists in the jukebox chasis I already have. The only thing I dont have for this project is the lcd display and the program to run it. The display I found for about $20 and well the program I am hoping someone will be willing to help me along with that. I do know the flow of program should be as follows -

User inputs number - say 100
program starts playing song 100.mp3 and awaits another input.
user inputs 220
220 has to be put in a queue so that after 100.mp3 is played 220.mp3 gets played and each song there after. And of course the id3 tag of the mp3 gets displayed on the lcd.


All times are GMT -5. The time now is 04:39 AM.