WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How to play audio CD  (Read 2693 times)

Offline cosminbro

  • Jr. Member
  • **
  • Posts: 68
How to play audio CD
« on: February 24, 2023, 07:28:00 AM »
How can I play audio CDs without ripping, like a CD player? Cd drive could be usb connected or even wit sata to usb adapter

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: How to play audio CD
« Reply #1 on: February 24, 2023, 10:53:39 AM »
mplayer, xmms, or many other programs.
The only barriers that can stop you are the ones you create yourself.

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 713
Re: How to play audio CD
« Reply #2 on: February 24, 2023, 11:15:23 AM »
vlc

Offline cosminbro

  • Jr. Member
  • **
  • Posts: 68
Re: How to play audio CD
« Reply #3 on: February 24, 2023, 03:13:12 PM »
I forgot to mention, I want a CLI player - e.g. commands in terminal... in piCore 64 v13. And cd player must not do convert cd tracks to wav, then play. I want a software to directly play audio CDs in realtime, like a real CD player.
« Last Edit: February 24, 2023, 03:28:29 PM by cosminbro »

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11623
Re: How to play audio CD
« Reply #4 on: February 24, 2023, 04:31:33 PM »
Hi cosminbro
That's too bad. I just tried  xmms  and it's pretty nice. It's very lightweight
and it plays CD audio discs directly. It's available in piCore 64 v13.

Offline CNK

  • Wiki Author
  • Sr. Member
  • *****
  • Posts: 283
Re: How to play audio CD
« Reply #5 on: February 24, 2023, 09:11:17 PM »
 
I forgot to mention, I want a CLI player - e.g. commands in terminal...

"cdplay" from cdtool does this. I'm not sure whether its available as an extension for any version of Tiny Core, but it probably wouldn't be a hard extension to create.

in piCore 64 v13. And cd player must not do convert cd tracks to wav, then play. I want a software to directly play audio CDs in realtime, like a real CD player.

Wait, now I'm lost. On PC the way you play an audio CD without converting it to wav is using the analogue audio output direct from the CD drive, which connects directly to sound card. If you're using a Raspberry Pi then you must be using some sort of USB connection to the CD drive, and these generally don't provide analogue audio output. Also I'm not sure that the USB CD-ROM drivers support the commands for playing audio CDs in analogue mode.

The Pi's onboard audio doesn't have an external input like a sound card, so even if you can get analogue audio output from the CD drive connected to a Raspberry Pi, you'll have to connect an amplifier to the drive directly. Any software that plays through the Pi's own audio output by definition must be converting the audio to wav (or another digital format) internally.

Just a side note: As an electronics project, it should be possible to connect the Pi's GPIO to an old IDE CD drive and write a custom program to issue the "play" (etc.) commands to the drive. There used to be some DIY CD player projects that did that with microcontrollers in the early 2000s.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11623
Re: How to play audio CD
« Reply #6 on: February 25, 2023, 12:46:27 AM »
Hi CNK
... On PC the way you play an audio CD without converting it to wav is using the analogue audio output direct from the CD drive, which connects directly to sound card. ...
My computer (Dell E310) has 2 DVD drives connected to the motherboard with ribbon cables, no audio cable.
CD audio and wav are basically the same thing. They both are 44.1 khz 16 bit data streams. The difference
is a CD has a table of contents used to locate each track while the wav file just has a header prepended to
the data so it can be accessed as a stand alone file.

Offline CNK

  • Wiki Author
  • Sr. Member
  • *****
  • Posts: 283
Re: How to play audio CD
« Reply #7 on: February 25, 2023, 04:37:38 AM »
... On PC the way you play an audio CD without converting it to wav is using the analogue audio output direct from the CD drive, which connects directly to sound card. ...
My computer (Dell E310) has 2 DVD drives connected to the motherboard with ribbon cables, no audio cable.

That's quite common, but only because the cable isn't fitted during assembly of the PC. Then when you try to use a player program like cdplay that uses the analogue mode, you don't hear anything becuase nothing's connected to the analogue audio output from the CD drive (alternatively older drives had hadphone sockets on the front which could still be used). You also need to make sure that the internal aux input isn't muted in the audio mixer. The disc usually spins slower in this mode (1x speed, presumably), like an audio CD player. The XMMS (v1) "CD Audio Player" plug-in has a "play mode" option that allows selecting between "Analog" and "Digital audio extraction" modes.

I fit the analogue audio cable in my PCs. There's also a digital audio output connector on some newer drives (along with the old 4-pin analogue one), I never figured out what that was about (even some Wikipedia-ing now isn't enlightening me).

Quote
CD audio and wav are basically the same thing. They both are 44.1 khz 16 bit data streams. The difference
is a CD has a table of contents used to locate each track while the wav file just has a header prepended to
the data so it can be accessed as a stand alone file.

The main advantage of the direct analogue output is that if the PC gets loaded up to 100% and the audio player process gets delayed, it doesn't interrupt CD playback becuase the CD drive is doing all the decoding work itself. Probably more important on Windows where things tend to lock up more often. The lower drive speed also reduces noise. Anyway it's not something to do with the CD format itself, just what generates the analogue audio signal.