LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-14-2004, 11:51 PM   #1
GreaperXtreme
LQ Newbie
 
Registered: Apr 2004
Posts: 3

Rep: Reputation: 0
Playing an Audio file from the shell?


Wuzzup My linux buddies. I'm a proud new member of the Linux Society, since my newly aquired job has me ssh'd into customers machines all day. Anyways, I have a windows machine and a redhat machine that I have on a lan. My question is this, how would I execute an audio file from a shell prompt? I'm also a newbie to Perl programming, and the new script idea I have will require me to open several audio files when called upon. So I just need to know how to play the damn things from the shell!

I'm a newbie to linux/shell sessions, so please don't beat me bloody for asking a dumb question like this! Thanks in advance guys!

#! /usr/bin/perl
$name = 'GreaperXtreme'; # He's a newbie.
 
Old 04-15-2004, 12:21 AM   #2
newinlinux
Member
 
Registered: Dec 2003
Location: Next to Equator
Distribution: GNU/Linux 2.6.14
Posts: 382

Rep: Reputation: 30
i hope i know what you are referring to, you can use madplay to play mp3 in the console. just type madplay song_name.mp3
 
Old 04-15-2004, 12:44 AM   #3
GreaperXtreme
LQ Newbie
 
Registered: Apr 2004
Posts: 3

Original Poster
Rep: Reputation: 0
Awesome thanks! So if I put them in mp3 format madplay can play them? But here's a good question, say I have to play several audio files very quickly back to back, is this going to just play the file or is it going to launch something to play the file.

Hopefully I asked that without sounding like a dummy

Thanks man!
 
Old 04-15-2004, 08:29 AM   #4
hiteshmaisheri
Member
 
Registered: Nov 2003
Location: Kerala, India
Distribution: Red Hat, Knoppix, Mandrake, FreeBSD
Posts: 231

Rep: Reputation: 30
you can just pass the files.mp3 one by one to it and it will play automatically back to back...
 
Old 04-15-2004, 08:30 AM   #5
hiteshmaisheri
Member
 
Registered: Nov 2003
Location: Kerala, India
Distribution: Red Hat, Knoppix, Mandrake, FreeBSD
Posts: 231

Rep: Reputation: 30
it should work...
 
Old 04-15-2004, 08:53 AM   #6
Mahony
Member
 
Registered: Jan 2004
Location: Glasgow
Distribution: Gentoo 2004.0, Debain 3.0r2, Mandrake 10.0 and Slackware 9.1
Posts: 173

Rep: Reputation: 30
There is a perl module that will allow you to play mp3's, check cpan.org (-:
 
Old 04-15-2004, 11:12 AM   #7
newinlinux
Member
 
Registered: Dec 2003
Location: Next to Equator
Distribution: GNU/Linux 2.6.14
Posts: 382

Rep: Reputation: 30
madplay is just like xmms or winamp, minus the pretty gui, that's all. Try it, i am playing my mp3 with it now. The will play one after another as you have them placed in your directory, and you can do fast forwards, shuffle etc.

try this:

madplay -z *

madplay will play your mp3 in the directory randomly, if you want them to play sequentially, just madplay *, that will do.
 
Old 04-15-2004, 11:20 AM   #8
ugge
Senior Member
 
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028

Rep: Reputation: 45
Also have a look at mpg123 which can play a hole directories and support shuffeling among many other things.
 
Old 04-15-2004, 11:27 AM   #9
KaruppuSwamy.T
Member
 
Registered: Apr 2004
Location: Chennai, India
Distribution: Mandrake 10.0/Redhat 8.0/Ubuntu 5.04/Windows XP (SP2)
Posts: 30

Rep: Reputation: 15
I am using mpg123 as mp3 player and "cplay" as front end tool. It is a good combination. you get almost all options in a Winamp or xmms. Pretty good. daily I am using it.

with wishes
swamytk
 
Old 04-16-2004, 01:00 PM   #10
hiteshmaisheri
Member
 
Registered: Nov 2003
Location: Kerala, India
Distribution: Red Hat, Knoppix, Mandrake, FreeBSD
Posts: 231

Rep: Reputation: 30
you can also use freeamp.. that is also a nice tool... that can be played from the text mode... as well as gui...
 
Old 04-16-2004, 03:15 PM   #11
qkslvrwolf
LQ Newbie
 
Registered: Apr 2004
Distribution: Lycoris Desktop/LX (Amethyst)
Posts: 14

Rep: Reputation: 0
As long as we're talking about linux sound options, is there an alarm clock program out there that will play my mp3's to wake me up at 6 in the morning? Preferably with gentle wake? I've looked around a bit, but I"ll the ones I've found are both windows and pay-to-play...
 
Old 04-16-2004, 03:44 PM   #12
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
I've found that play (part of Sox) works well if you just want to play a sound, like a short wav file when you receive mail, for example.

For the alarm clock, you could make a cron job to do that with mpg321. I don't know what "gentle wake" is, though.
 
Old 04-16-2004, 03:45 PM   #13
IRIGHTI
Member
 
Registered: Oct 2003
Distribution: Slackware64 13.1 x86_64, Ubuntu 10.04 x86_64
Posts: 121

Rep: Reputation: 15
Just set up a cron job to play the mp3 with madplay at a certain time.

EDIT: Dang you mikshaw!!
 
Old 04-16-2004, 07:15 PM   #14
GreaperXtreme
LQ Newbie
 
Registered: Apr 2004
Posts: 3

Original Poster
Rep: Reputation: 0
Exclamation

Actually guys what I'm doing is creating a program that converts my text into my voice. So I am recording all the combinations of the english language, like "a" and "ah" for a, and ssss and Ssshh for s and sh. Anyways it's just an exercise I'm doing.... I have it all worked out in my head, and my buddy told me just to call on "play". If you do a "man play" you can see it's function.

Thanks for all the feedback though!
 
Old 04-16-2004, 07:43 PM   #15
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
Isn't that what I suggested? Uh-huh...thought so.... *does a little touchdown shuffle
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
playing audio cd 5.1 alizta Linux - General 2 10-25-2004 04:20 AM
Help with playing audio CD... Dickey Peterson Linux - Newbie 5 01-13-2004 10:04 AM
Playing an Audio CD natesch Linux - Newbie 15 08-31-2003 05:30 PM
Playing an audio CD fredws Linux - General 2 03-18-2003 04:56 PM
Audio CD not playing Relja Linux - General 6 01-22-2003 06:31 AM


All times are GMT -5. The time now is 08:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration