Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: (Linux) shnsplit flac conversion (Read 25981 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

(Linux) shnsplit flac conversion

Dear Friends

I often get wavepack files with cue sheets. I couldn't find any way to convert the wavepack into flac under Ubuntu. The only think I could do is the following splitting/conversion with this command

Code: [Select]
cuebreakpoints file.cue | shnsplit -o flac file.wv


Now I wonder which options (e.g. compression level) are used to create the flacs. There is any strategy to pass flac parameters  to shnsplit?


I hope somebody can help.
Best Wishes
Tito

(Linux) shnsplit flac conversion

Reply #1
Quote
Now I wonder which options (e.g. compression level) are used to create the flacs. There is any strategy to pass flac parameters to shnsplit?


I hope somebody can help.



There are two ways to do this. You could write a script in BASH that does it automatically (which might take some time)

Try using a combination of wavunpack and flac in a script combination or a separate script to rencode them to flac.

or you go into synaptic package manager and look for a program called "SoundKonverter". Make sure it has all of the necessary dependencies installed before you use it! It will tell you what's required. I think it handles CUE sheets and I know it handles ReplayGain tags. It's a KDE frontend that allows you externally specify various binary encoders x86 or 64-bit based ones.
budding I.T professional

(Linux) shnsplit flac conversion

Reply #2
Code: [Select]
cuebreakpoints file.cue | shnsplit -o flac file.wv


Now I wonder which options (e.g. compression level) are used to create the flacs. There is any strategy to pass flac parameters  to shnsplit?

Two things:
  • shntool can handle CUE sheets natively nowadays, just pass it on stdin or via the -f option.
  • yes, you can specify flac parameters on the command line or via environment variables.  'man shntool'

Here is a sample showing both, using shntool's default flac encoding parameters.  Tailor this as needed:

Code: [Select]
shnsplit -f file.cue -o "flac flac -s -o %f -" file.wv

(Linux) shnsplit flac conversion

Reply #3
Thanks that's what I needed.

If I well understood  In order to pass parameters to flac all I need is:

Code: [Select]
"flac flac paramters"



Is that correct?

Best
Tito


...snip...
Here is a sample showing both, using shntool's default flac encoding parameters.  Tailor this as needed:

Code: [Select]
shnsplit -f file.cue -o "flac flac -s -o %f -" file.wv


(Linux) shnsplit flac conversion

Reply #4
That is correct!

(Linux) shnsplit flac conversion

Reply #5
I've got the following error trying to do it:
Code: [Select]
:~/Temp$ shnsplit -f disk.cue -o "flac flac -s -o %f -" disk.wv
shnsplit: warning: none of the builtin format modules handle input file: [disk.wv]
shnsplit: error: cannot continue due to error(s) shown above


I'm using Ubuntu Lucid and I've got wavpack 4.6.1 installed.

(Linux) shnsplit flac conversion

Reply #6
Code: [Select]
#!/bin/bash
ls |egrep '[fF][lL][aA][cC]|[aA][pP][eE]|[wW][vV]|[wW][aA][vV]' |while read LSSLSS; do
shnsplit -f *.cue -o flac "$LSSLSS";
rm split-track00.flac;
cuetag *.cue `ls split-track*.flac`;
lltag --yes --no-tagging --rename '%n - %a - %t' `ls split-track*.flac`;
done


That will split cue+lossless to individual flacs, named and tagged.  As well as cuetools and shntool installed you need lltag which is in Debian and Ubuntu repositories.

You can see more about this and variations and some different methods and useful tips at http://aidanjm.wordpress.com/2007/02/15/sp...av-by-cue-file/

(Linux) shnsplit flac conversion

Reply #7
You can use the GUI program flacon (you can find it at www.kde.org, it is a QT4 program), to break up a wavpack (ape, flac ...) + cue into separate files.
It preserves the tags within the cue sheet (with the exception of the comment tag).

Other option is Foobar + Wine

 

(Linux) shnsplit flac conversion

Reply #8
You can use the GUI program flacon (you can find it at www.kde.org, it is a QT4 program), to break up a wavpack (ape, flac ...) + cue into separate files.
It preserves the tags within the cue sheet (with the exception of the comment tag).

Other option is Foobar + Wine

Have tried flacon with similar results:

Code: [Select]
type object 'OpenFileError' has no attribute 'NotSupported'

(Linux) shnsplit flac conversion

Reply #9
Code: [Select]
#!/bin/bash
ls |egrep '[fF][lL][aA][cC]|[aA][pP][eE]|[wW][vV]|[wW][aA][vV]' |while read LSSLSS; do
shnsplit -f *.cue -o flac "$LSSLSS";
rm split-track00.flac;
cuetag *.cue `ls split-track*.flac`;
lltag --yes --no-tagging --rename '%n - %a - %t' `ls split-track*.flac`;
done


That will split cue+lossless to individual flacs, named and tagged.  As well as cuetools and shntool installed you need lltag which is in Debian and Ubuntu repositories.

You can see more about this and variations and some different methods and useful tips at http://aidanjm.wordpress.com/2007/02/15/sp...av-by-cue-file/

same problem here:
Code: [Select]
./split
shnsplit: warning: none of the builtin format modules handle input file: [file.wv]
shnsplit: error: cannot continue due to error(s) shown above
rm: cannot remove `split-track00.flac': No such file or directory
ls: cannot access split-track*.flac: No such file or directory
warning: number of files does not match number of tracks
ls: cannot access split-track*.flac: No such file or directory

(Linux) shnsplit flac conversion

Reply #10
apt-cache show shntool

Code: [Select]
shntool has native support for .wav files. If you want it to work with
other formats, you must have the appropriate helper program installed.


man shnsplit

Code: [Select]
       The following formats are currently supported:

              wav    RIFF WAVE file format

              aiff   Audio Interchange File Format (AIFF and uncompressed/sowt AIFF-C only) (via 'sox'):
                     <http://sox.sourceforge.net/>

              shn    Shorten low complexity waveform coder (via 'shorten'):
                     <http://www.softsound.com/Shorten.html>
                     <http://www.etree.org/shnutils/shorten/>

              flac   Free Lossless Audio Codec (via 'flac'):
                     <http://flac.sourceforge.net/>

              ape    Monkey's Audio Compressor (via 'mac'):
                     <http://www.monkeysaudio.com/>
                     <http://supermmx.org/linux/mac/>

              ofr    OptimFROG Lossless WAVE Audio Coder (via 'ofr'):
                     <http://www.losslessaudio.org/>

              lpac   Lossless Predictive Audio Compression (via 'lpac'):
                     <http://www.nue.tu-berlin.de/wer/liebchen/lpac.html>

              wv     WavPack Hybrid Lossless Audio Compression (via 'wavpack' and 'wvunpack'):
                     <http://www.wavpack.com/>

              alac   Apple Lossless Audio Codec (via 'alac'):
                     <http://craz.net/programs/itunes/alac.html>

              la     Lossless Audio (via 'la'):
                     <http://www.lossless-audio.com/>

              tta    TTA Lossless Audio Codec (via 'ttaenc'):
                     <http://tta.sourceforge.net/>

              als    MPEG-4 Audio Lossless Coding (via 'mp4als'):
                     <http://www.nue.tu-berlin.de/forschung/projekte/ ‐
                     lossless/mp4als.html>
              tak    (T)om's lossless (A)udio (K)ompressor (via 'takc'):
                     <http://www.thbeck.de/Tak/Tak.html>

              bonk   Bonk lossy/lossless audio compressor (via 'bonk'):
                     <http://www.logarithmic.net/pfh/bonk>

              kxs    Kexis lossless WAV file compressor (via 'kexis'):
                     <http://www.sourceforge.net/projects/kexis/>

              mkw    MKW Audio Compression format (via 'mkwcon'):
                     <http://www.etree.org/shnutils/mkwcon/>

              cust   Custom output format module (output only, useful for encoding to a format that shntool does  not  yet
                     support)

              term   sends output to the terminal

              null   sends  output  to  /dev/null  (output only, useful for dry‐runs in several modes, such as fix mode or
                     strip mode)


shnsplit (part of shntool) definitely supports wavpack if you have wavpack installed (wvunpack is included in wavpack).

I suggest you make sure you have installed cuetools, flac and wavpack.  I'm using these tools in Debian and that script decodes and splits cue+wavpack|ape|wav|flac just fine.  I think it's reasonable to assume the equivalent packages in Ubuntu are identical except for the version names (this is true of about 70% of Ubuntu packages).

You can check the status of these packages in Synaptic or you can run
Code: [Select]
$ apt-cache policy wavpack
Code: [Select]
$ apt-cache policy flac
Code: [Select]
$ apt-cache policy cuetools


This will show you what is installed and what is available in each case.

(Linux) shnsplit flac conversion

Reply #11
I've got them all installed. Yesterday I tried manually convert file.wv into wav using wvunpack and it worked fine. I have split then the wav file. Probably it is a problem with integration of wavpack into shntool?

(Linux) shnsplit flac conversion

Reply #12
I've got them all installed. Yesterday I tried manually convert file.wv into wav using wvunpack and it worked fine. I have split then the wav file. Probably it is a problem with integration of wavpack into shntool?

That shouldn't be a problem.  If wavpack is in your PATH, then shntool should see it and use it.  No special version of wavpack is needed.

What is the output of the following:

Code: [Select]
% shntool info -DD file.wv
% shntool -v


(Linux) shnsplit flac conversion

Reply #13
I've got them all installed. Yesterday I tried manually convert file.wv into wav using wvunpack and it worked fine. I have split then the wav file. Probably it is a problem with integration of wavpack into shntool?

There is another possibility. The way shntool works is by examining the first few bytes of the input file to determine the type, and in your case it looks like it's not working (I assume there is a different message if shntool recognizes the format but can't find the decoder). This could happen for several reasons. A self-extracting WavPack file has the self-extraction header on the beginning which would cause the test to fail. Also, those .iso.wv files have stuff before the first WavPack block.

The command-line wvunpack program works fine with these files because it searches up to 1 MB for a valid WavPack block. Unfortunately, I was not able to find a shntool option to override the format test (there is no "-i cust ...").

David

edit: if you try the -DD option as shnutils suggests, it will show the bytes at the beginning of the file that are causing the identification failure (I just tried it on Ubuntu)

(Linux) shnsplit flac conversion

Reply #14
The command-line wvunpack program works fine with these files because it searches up to 1 MB for a valid WavPack block. Unfortunately, I was not able to find a shntool option to override the format test (there is no "-i cust ...").

Nowadays everything is technically its own custom format.  :-)  Try modifying the default (obtained via "shntool -a"):

Code: [Select]
-i "wv wvunpack -q -y %f -o -"

(Linux) shnsplit flac conversion

Reply #15
Nowadays everything is technically its own custom format.  :-)  Try modifying the default (obtained via "shntool -a"):

Funny, I had just tried that exact command and it still failed, but my shntool is old (3.0.3). Is this something fairly recent? If so it should definitely fix the OP's issue.

BTW, thanks for keeping WavPack support in shntools! 

(Linux) shnsplit flac conversion

Reply #16
Nowadays everything is technically its own custom format.  :-)  Try modifying the default (obtained via "shntool -a"):

Funny, I had just tried that exact command and it still failed, but my shntool is old (3.0.3). Is this something fairly recent? If so it should definitely fix the OP's issue.

BTW, thanks for keeping WavPack support in shntools! 

No problem, as I recall you made it easy for me by providing detection code. 

"shntool -a" is simply a helpful command added in 3.0.8; the functionality it describes (modifying encoder/decoder parameters) has existed since 3.0.0.  So your version should support the -i decoder modifications.  That said, I don't think it's going to make a difference here, since the issue centers around shntool's WavPack detection code itself (which is run prior to calling the decoder).

Version 3.0.8 is also the version that added support for self-extracting WavPack files, which I believe is the 1MB check.  So my current suspicion is either a) TA123's shntool version is earlier than 3.0.8, or b) I have a bug in my 1MB scanning code.  I will know more when TA123 responds with his results.

BTW, I had to chuckle when I saw this in my code:

Code: [Select]
  /* like WavPack, we check the first 1 meg of the file for a header. */
  /* unlike WavPack, we do it in the most inefficient way possible.   */


(Linux) shnsplit flac conversion

Reply #17
I just downloaded and built 3.0.10 and it works fine on the test files I created to test this issue. The latest version packaged by Ubuntu is 3.0.7, so that probably explains the OP's issue.

No problem, as I recall you made it easy for me by providing detection code. 
Ah yes, I remember that now! I'll have to make sure I don't break that code in the future! 

Code: [Select]
  /* like WavPack, we check the first 1 meg of the file for a header. */
  /* unlike WavPack, we do it in the most inefficient way possible.   */



(Linux) shnsplit flac conversion

Reply #18


here you are:
Code: [Select]
$ shntool info -DD file.wv
shntool [info]: warning: none of the builtin format modules handle input file: [file.wv]
shntool [info]: debug1: found 4-byte magic header 0x3F3F3F3F [????] in file: [file.wv]


Code: [Select]
$ shntool -v
shntool 3.0.7
Copyright (C) 2000-2008 Jason Jordan <shnutils@freeshell.org>

(Linux) shnsplit flac conversion

Reply #19
here you are:
Code: [Select]
$ shntool info -DD file.wv
shntool [info]: warning: none of the builtin format modules handle input file: [file.wv]
shntool [info]: debug1: found 4-byte magic header 0x3F3F3F3F [????] in file: [file.wv]

Perhaps not the header I was expecting for a self-extracting WavPack file, but I don't think it matters.  If it extracted with wvunpack, it should also work with shntool 3.0.8+.

Code: [Select]
$ shntool -v
shntool 3.0.7
Copyright (C) 2000-2008 Jason Jordan <shnutils@freeshell.org>

Thank you.  It looks like David's hunch was correct, i.e. you have an outdated version of shntool.  Your file has something prepended to it (most likely a self-extraction stub), and your version of shntool can't handle it.  If you are able to upgrade to 3.0.8 (or later), then you should be able to use these types of files directly in shntool.  Otherwise, you will need to decompress them outside of shntool, and run shntool on the resulting WAVE file.

(Linux) shnsplit flac conversion

Reply #20
Hello

Sorry for bringing an old thread to live but I have a few questions regarding shntool behavior:

1) Does running the following command
shnsplit -o flac -f cuesheet.cue image.flac
result in re-encoding or just splicing? Is it possible to split
without re-encoding at all? It is quite important when lossy formats
are involved or on older PCs where encoding is slow.

2) Can shntool generate a new cuesheet for tracks created during
split? From my understanding shnsplit appends pre-gap (INDEX 00) to
previous track. Cuesheet specification doesn't provide for such
situation but it's possible to create non-standard cuesheet that is
accepted by many CD burning tools.

Regards,
ptrkmj