LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-29-2008, 02:21 AM   #1
barker1977
LQ Newbie
 
Registered: Aug 2008
Location: Melbourne
Distribution: Red Hat, Debian
Posts: 2

Rep: Reputation: 0
Playing and looping audio cds from command line


Hi All,

At work we'd like to be able to play an audio cd in our server and use it as the hold music for our phones.

Our server has no sound card so we need to play audio cds and plug the phone input into the headphone socket on the cd drive.

I've been able to play cds using this method with no problems (using cdtools for example).

The problem is we'd like to have the cd repeat (cdtools gets to the end and stops). I've googled and can't seem to find any software that will let me play audio cds on repeat from the command prompt. We don't have the server hooked up to a monitor/keyboard an usually just connect using putty. I know I can probably setup x11 forwarding and use some pretty gui, but i'd like to be able to control the app from the command line so I can setup cronjobs to turn it off/on for business hours only.

I know I can probly set up some crons to play the cd from the start every 1/2 hour, but its not very elegant.

Any ideas on what I could use? Anything I'm not thinking of that will be easier?

BTW, its a debian server on 2.6.18-4-686-bigmem kernel. We've also got a few red hat ES4 (2.6.9-67.0.15.EL) vms running on it as well so I can use one of those if need be.

Thanks
 
Old 08-29-2008, 03:40 AM   #2
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
Wouldn't it be easier to rip the CD to mp3 or ogg or some format that can be played back using any command-line player (mpg123, mplayer, play...)
and script the playback so it starts over once it is finished?
while true play...?

[edit]
I somehow missed the point :/
A cheap mp3-player in loop-mode perhaps instaed of the CD-drive?
If you can start the playback via software/command-line the loop should be scriptable with the CD-drive too.

Last edited by jomen; 08-29-2008 at 04:06 AM.
 
Old 08-29-2008, 03:57 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Why not get a real cd player and run in in loop mode? CD access can cause problems, especially if the CD develops a problem. Some admins even unplug the CD drive on the servers so someone doesn't leave in a disk.
 
Old 08-29-2008, 04:09 AM   #4
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Rep: Reputation: 198Reputation: 198
Use a simple wrapper script that runs the command that plays the CD and then calls itself?

Code:
#!bin/bash
command_to_play_cd arguments
exec $0
This assumes of course that command_to_play_cd does not exit until it has finished playing the CD.

Though if I were you I'd forget playing the CD entirely and do as jomen suggests and rip what you want to play to mp3 or whatever.
 
Old 08-30-2008, 08:41 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
The server doesn't have a sound card, so he can't play mp3's on the server. However, having a cd running on a server isn't a very good idea IMHO. I would suggest getting a cheap mp3 player and have it play a playlist in loop mode. I picked up an ugly Craig mp3 player in a drug store for $30.

You don't want the server to stop working because a CD disc is going bad. If a hard disk is on the same controller card, the perfomance may suffer even if the CD is OK.
 
Old 08-31-2008, 06:02 PM   #6
barker1977
LQ Newbie
 
Registered: Aug 2008
Location: Melbourne
Distribution: Red Hat, Debian
Posts: 2

Original Poster
Rep: Reputation: 0
I hadn't thought about the cd drive causing problems/ performance issues. Getting a cheap mp3 player might be a better option.

Cheers for the advice.
 
  


Reply



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 CDs Valkyrie_of_valhalla Linux - Software 3 10-28-2006 04:42 AM
Playing audio cds (again...sorry) Oholiab Slackware 13 10-16-2005 02:26 PM
No sound when playing audio files on Fedora using command line players k_wjss Linux - Newbie 0 10-01-2004 01:32 AM
Playing audio cds iantri Slackware 5 07-25-2003 04:10 PM
How to listen to audio CDs on Suse7 using the command line? juszuf7 Linux - General 1 10-10-2002 07:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:23 PM.

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
Open Source Consulting | Domain Registration