Discussion:
[MPlayer-users] Playing (one large) WAV/MP3/... and a corresponding .cue-sheet?
Christian
2015-08-10 20:47:07 UTC
Permalink
Hello all,

I have ripped a number of CDs to large, single WAV-files. That is, one
CD = one file. I also have the corresponding .cue-sheet which
obviously contains the starting time of each "track" within my WAV
file.

Is there a way to make player recognize my WAV and .cue as "one unit"
so that I can skip to the next track as defined by the cue sheet (or
back one track)?

Here's an excerpt from my cuesheet as made by mkcue:

FILE "cdda.wav" WAVE
TRACK 01 AUDIO
INDEX 01 00:00:00
TRACK 02 AUDIO
INDEX 01 03:17:28
TRACK 03 AUDIO
INDEX 01 05:37:66
TRACK 04 AUDIO
INDEX 01 07:34:03
(...)

I have thought about a helper scripts that parses the current cue
sheet, the sends "seek xxx 2" commands to player via a fifo pipe
whereas xxx is a calculated value from the cue sheet. Yet this seems
overly complicated and might already be included.

Another thought is, can playlists contain "chapters" for a single WAV
file? That way I could translate my cue sheet to that sort of
playlist.

Thank you,
Christian.
Reimar Döffinger
2015-08-11 06:45:08 UTC
Permalink
Post by Christian
Hello all,
I have ripped a number of CDs to large, single WAV-files. That is, one
CD = one file. I also have the corresponding .cue-sheet which
obviously contains the starting time of each "track" within my WAV
file.
Is there a way to make player recognize my WAV and .cue as "one unit"
so that I can skip to the next track as defined by the cue sheet (or
back one track)?
I think we do support .cue files, but unfortunately only in combination with .iso files I believe.
Post by Christian
Another thought is, can playlists contain "chapters" for a single WAV
file? That way I could translate my cue sheet to that sort of
playlist.
Not that I know, but formats like Matroska support chapters.
So you could check if you can pack the wav file into one with mkvmerge and appropriate chapters.
Ingo Brückl
2015-08-11 12:13:09 UTC
Permalink
Post by Christian
I have ripped a number of CDs to large, single WAV-files.
Is there a way to make player recognize my WAV and .cue as "one unit"
so that I can skip to the next track as defined by the cue sheet (or
back one track)?
You should have ripped to raw bin/cue images which allow what you want
(as well as converting into different audio formats, like wav, mp3, ...,
if desired).

Ingo
Christian
2015-08-12 09:22:39 UTC
Permalink
Using cvlc allows me to play an mp3/WAV "throught" the intermediate
use of it's cue sheet, so I guess my question was valid.
Would you happen to have a command line example for me how to use
cdparanoia to rip to a bin/cue pair and play that pair with player,
pease?

Thanks,
Christian.
Post by Ingo Brückl
Post by Christian
I have ripped a number of CDs to large, single WAV-files.
Is there a way to make player recognize my WAV and .cue as "one unit"
so that I can skip to the next track as defined by the cue sheet (or
back one track)?
You should have ripped to raw bin/cue images which allow what you want
(as well as converting into different audio formats, like wav, mp3, ...,
if desired).
Ingo
_______________________________________________
MPlayer-users mailing list
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users
houghi
2015-08-12 09:43:47 UTC
Permalink
Post by Christian
Using cvlc allows me to play an mp3/WAV "throught" the intermediate
use of it's cue sheet, so I guess my question was valid.
Would you happen to have a command line example for me how to use
cdparanoia to rip to a bin/cue pair and play that pair with player,
pease?
Just curious. Would it not be easier to either just re-rip the CD or use
a sound editor to manually cut the soundfile?

I personally would go for the first option. Last time I ripped all my
CDs (about 300 or so) it went pretty fast. About 5 minutes per CD if I
can remeber correctly. Was on an older machine and included encoding to
mp3. Those even can sometimes rename the songs correctly by connection
to an online database.

There are different (free) rippers available for almost every OS.

If you want wav files, and run Linux, you could just mount the CD/ISO
and copy the files. Even faster and if you have many CD's, a simple
script that even icluded open and closing of the CD player should not be
too hard.

Again: this is what I would do as it is so much easier. It does not take
away the theoretical solution of what you ask. My _personal_ choice
would be to re-rip the CD/ISO to whatever I want it to be and if I was
not in possestion of the CD/ISO to do a manual clipping with a sound
editor.

Kind regards,

houghi
Christian
2015-08-12 20:15:03 UTC
Permalink
Just curious. Would it not be easier to either just re-rip the CD or use a
sound editor to manually cut the soundfile?
Here's what I'm working on (and it might explain why I need to rip to
one WAV file first):

I'm building a CD player for my daughter using a RasPi and a slot-in USB CD-ROM.
Once a CD is inserted I check the CD ID using cd-discid. If the CD has
already been ripped, play the rip (here player would come into action
as I can now pause, forward one track, back one track etc. using GPIO
buttons).
If the CD is new, ie. hasn't been ripped yet, rip it and play it back
at the same time.
I start cdparanoia to rip to WAV file, wait until the WAV file is >5
megs in size, then play it using player (obviously now without and
forward-skip as we haven't ripped that part yet). Once the rip is
down, encode it to mp3. Once playing is done, delete the WAV. Eject
the CD.

So here we are... ;)
Peter White
2015-08-13 12:43:25 UTC
Permalink
Reading through this thread I think I might add some ideas for an
alternative approach.
Post by Christian
Just curious. Would it not be easier to either just re-rip the CD or use a
sound editor to manually cut the soundfile?
Here's what I'm working on (and it might explain why I need to rip to
I'm building a CD player for my daughter using a RasPi and a slot-in USB CD-ROM.
Once a CD is inserted I check the CD ID using cd-discid.
cd-discid also provides the number of tracks (2nd field) to populate a
playlist before the rip has even started.
Post by Christian
If the CD is new, ie. hasn't been ripped yet, rip it and play it back
at the same time.
This is where that playlist would come into play, obviously.
Post by Christian
I start cdparanoia to rip to WAV file, wait until the WAV file is >5
megs in size, then play it using player (obviously now without and
forward-skip as we haven't ripped that part yet).
Just to be clear, when you say 'player' you mean mplayer?

Also, you can have cdparanoia rip to individual WAV files with -B. The
naming scheme is documented in the man page. With the information
gathered from cd-discid you should be able to create the playlist and
start playback when the first file hits your desired threshold size.
Post by Christian
Once the rip is
down, encode it to mp3.
Encoding can start as soon as the first track will have been ripped.
Post by Christian
Once playing is done, delete the WAV. Eject
the CD.
You can delete the file while it is playing already. The name will
disappear from the filesystem, but the inode will stay as long as
mplayer has it open.

There is only one problem I see with playing the ripped WAV file, be it
with your approach or any other. If cdparanoia takes longer to rip it
than the play time, due to defects and resulting error handling,
playback in mplayer will stop prematurely due to EOF at some point.
If you play it as cdda:// that should not happen, but exhibit skips or
breaks.

On a side note, in another reply you said, that cvlc works with
.wav/.cue. Is there a specific reason not to use it then for your
purposes?

Peter
Christian
2015-08-15 12:10:31 UTC
Permalink
Post by Peter White
Just to be clear, when you say 'player' you mean mplayer?
Yes, sorry. Typo.
Post by Peter White
Also, you can have cdparanoia rip to individual WAV files with -B. The
naming scheme is documented in the man page. With the information
gathered from cd-discid you should be able to create the playlist and
start playback when the first file hits your desired threshold size.
Interesting idea, I'll give that a try.
Post by Peter White
On a side note, in another reply you said, that cvlc works with
.wav/.cue. Is there a specific reason not to use it then for your
purposes?
I'm using it now, yet I prefer mplayer for audio over most, if not
any, other player(s) ;)
Ingo Brückl
2015-08-12 10:52:05 UTC
Permalink
Post by Christian
so I guess my question was valid.
Well, I don't say that it would be impossible. If MPlayer could use the cue
file as a kind of playlist and would play skippingly then and had a duration
option (which AFAIK it hasn't), it would be possible to play any supported
format given in a cue file.
Post by Christian
Would you happen to have a command line example for me how to use
cdparanoia to rip to a bin/cue pair and play that pair with player,
pease?
Actually, I don't know what exactly you are trying to achieve. My goal was to
simulate a (one day non-existing) CDROM device by using a bin/cue file:

Rip with cdrdao:

cdrdao read-cd --device /dev/hdc --read-raw --datafile cd.bin cd.toc

Convert the results:

dd conv=swab if=cd.bin of=cd_swap && mv cd_swap cd.bin
toc2cue cd.toc cd.cue

Now play the CD with gmplayer (CD -> Play):

gmplayer -cdrom-device cd.cue

You can select individual tracks and jump back and forth (as you can with a
real CDROM device).

Ingo
Ingo Brückl
2015-08-13 07:28:43 UTC
Permalink
If the CD has already been ripped, play the rip
So no reason to not rip to bin instead of wav.
If the CD is new, ie. hasn't been ripped yet, rip it and play it back
at the same time.
Is it possible to play the CD with mplayer cdda:// while ripping and
encoding?
Once the rip is down, encode it to mp3. Once playing is done, delete the
WAV. Eject the CD.
So you delete the rip? How can you play it then?

Ingo
Nicolas George
2015-08-13 09:17:11 UTC
Permalink
Post by Ingo Brückl
So no reason to not rip to bin instead of wav.
In this case, riping to individual WAVE files looks like a better idea.
Post by Ingo Brückl
Is it possible to play the CD with mplayer cdda:// while ripping and
encoding?
Very every bad idea: the ripping and the playing have no reason to be in
sync, and since audio CD have no cache, the drive will seek permanently,
making the ripping awfully slow, the playback inaudible and killing the
drive.

Regards,
--
Nicolas George
Christian
2015-08-13 09:55:34 UTC
Permalink
Post by Ingo Brückl
So no reason to not rip to bin instead of wav.
Except that I have no known way of converting bin/cue to MP3 (besides
maybe having a completed rip, then "mounting" that rip somehow, bit
that won't let me play it while I rip it.
Post by Ingo Brückl
Post by Christian
If the CD is new, ie. hasn't been ripped yet, rip it and play it back
at the same time.
Is it possible to play the CD with mplayer cdda:// while ripping and
encoding?
Technically yes, but it stutters enormously as the CDROM has to jump
back and forth all the time in increasingly larger steps as playing is
slower then ripping.
Post by Ingo Brückl
Post by Christian
Once the rip is down, encode it to mp3. Once playing is done, delete the
WAV. Eject the CD.
So you delete the rip? How can you play it then?
I keep the WAV for as long as a) the encoding to mp3 goes on and b)
for as long at it is played "for the first time", ie. for the duration
of the playback-while-ripping-and-encoding phase.
houghi
2015-08-13 11:14:28 UTC
Permalink
Post by Christian
Post by Ingo Brückl
So no reason to not rip to bin instead of wav.
Except that I have no known way of converting bin/cue to MP3 (besides
maybe having a completed rip, then "mounting" that rip somehow, bit
that won't let me play it while I rip it.
The essence is, if I am correctly: Is it possible to rip while the music
is playing?

If that is what is wanted, then I doubt it. Mainly beceause ripping and
playing are done at different speeds. What you perhaps try to do is play
the CD and then catch the sound and rip that at the same time.

As you just capture input, you do not have the difference between the
songs hence the big wav file.

What you could do is the following (not exactly what you want) is to rip
the first song. As soon as that is done, start playing that song. and
start ripping the next one. Add the second song to the queue of mplayer
and so on till the last one.

You will have a delay in the start of playing. You could even increase
the delay by first copying the first song as wav and when the copy is
ready, start playing.

Not sure what the speed is on a RPi, but that might help. What you are
in fact doing is making a cache of the first file and then work from
that.
As you are working from song to song, you do not get one big wav file.

Depending on speed and situation, you could also first rip all the songs
one by one before you start ripping.

That way you have two seperate processes next to each other.
1) Copying the files one by one and playing them
2) Ripping the files to ogg or whatever

In any case, I would aproach it on a song by song basis and not a CD
basis that then becomes song by song.

Kind regards,

houghi
Ingo Brückl
2015-09-08 12:10:04 UTC
Permalink
Post by Christian
I have ripped a number of CDs to large, single WAV-files.
Is there a way to make player recognize my WAV and .cue as "one unit"
so that I can skip to the next track as defined by the cue sheet (or
back one track)?
MPlayer's GUI is capable of doing this now. It "plays" cue files.

Ingo

Loading...