Open twojstaryzdomu opened 2 years ago
Nice! It handles cue+wav only extraction.
I'm seeing an error in this patch, though.
bchunk -w foo.wav foo.cue
Reading the CUE file:
File: foo.wav
Track 1: AUDIO 01 00:00:00
free(): double free detected in tcache 2
Aborted
It also destroyed my wav file. Needs work.
Please post the cuesheet. A bin file should be intact. Dumping from wav to wav makes no sense to me. What is your exact use use case
This file was using Unix line ending style (0x0a or \n), just so you know.
REM GENRE Rock
REM DATE 2007
PERFORMER "Some Guy"
TITLE "Some Album"
FILE "Some Guy - Some Album.wav" WAVE
TRACK 01 AUDIO
TITLE "Foo"
PERFORMER "Some Guy"
INDEX 01 00:00:00
TRACK 02 AUDIO
TITLE "Bar"
PERFORMER "Some Guy"
INDEX 00 03:35:01
INDEX 01 03:36:59
TRACK 03 AUDIO
TITLE "Blarg"
PERFORMER "Some Guy"
INDEX 01 06:18:60
TRACK 04 AUDIO
TITLE "Song"
PERFORMER "Some Guy"
INDEX 01 09:55:27
TRACK 05 AUDIO
TITLE "Another Song"
PERFORMER "Some Guy"
INDEX 01 13:29:19
TRACK 06 AUDIO
TITLE "Yet another song"
PERFORMER "Some Guy"
INDEX 01 16:34:29
TRACK 07 AUDIO
TITLE "Yet another song"
PERFORMER "Some Guy"
INDEX 00 19:29:48
INDEX 01 19:30:28
TRACK 08 AUDIO
TITLE "Yet another song"
PERFORMER "Some Guy"
INDEX 01 22:32:01
TRACK 09 AUDIO
TITLE "Yet another song"
PERFORMER "Some Guy"
INDEX 00 26:31:54
INDEX 01 26:33:37
TRACK 10 AUDIO
TITLE "Yet another song"
PERFORMER "Some Guy"
INDEX 00 30:10:56
INDEX 01 30:12:39
TRACK 11 AUDIO
TITLE "Yet another song"
PERFORMER "Some Guy"
INDEX 00 33:05:60
INDEX 01 33:07:53
TRACK 12 AUDIO
TITLE "Yet another song"
PERFORMER "Some Guy"
INDEX 00 37:13:52
INDEX 01 37:14:74
file(1)
reports this as the WAV file contents:
Some Guy - Some Album.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 44100 Hz
Here's the output from ls -la
:
-rw-r--r-- 1 h3xx users 433,539,500 Jun 25 00:26 Some\ Guy\ -\ Some\ Album.wav
Dumping from wav to wav makes no sense to me. What is your exact use use case
Dumping from .wav to .wav is for splitting wavs on the INDEX
values in the cue sheet. Some of the music on archive.org exists in an hour-long .wav + a .cue file with chapters for the tracks.
bchunk already handles splitting .wav files from .bin files if an AUDIO
type track is specified in the cue sheet. See the -w
flag.
If your patch isn't meant to add support for this, then maybe I'm out of luck. I've wanted to use this tool for splitting .wavs for a long time.
Dumping from .wav to .wav is for splitting wavs on the INDEX values in the cue sheet. Some of the music on archive.org exists in an hour-long .wav + a .cue file with chapters for the tracks.
bchunk
seems to handle simple tracks without pregaps. The problem is the tool hasn't been meant for anything else than simple cuesheets. Your example and most audio CDs tend to have pregap. Any result of a split may seem ok at first but not on closer look. If you get it to run, with any track that is followed by pregap, tracks will be overlapping at the end.
I have some code to make it work and will submit a PR later at some point when the code has been tested. It's very easy to wreck your rips by splitting in the wrong place. However, I won't be adding it under this PR.
@h3xx, I've added support for WAV splitting in my devel branch. Regular PCM WAV files ripped from CDs ought to work (44,1k). Any other type will not. It should handle pregap and ignore subtracks as well. Verify your split files with CUETools. The accurip output (Verify option in CUETools) has to be identical for the original cue/WAV source and the split single WAV's (files named in the same order as cue tracks).
Since WAV splitting seems to be working, including a few edge cases (pregaps, subtracks), I'm including the WAV splitting enhancement in this PR.
This PR enables the following:
*
(in single quotes) selects all tracks from all files listed.##
as track token in basename. I doubt this combination is used anywhere in filenames.-t
or the variant basename isn't specified .-t
is specified.