IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
(Linux) shnsplit flac conversion
titox
post Mar 24 2010, 16:17
Post #1





Group: Members
Posts: 13
Joined: 9-February 10
Member No.: 78034



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
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
Go to the top of the page
+Quote Post
HotshotGG
post Mar 24 2010, 17:20
Post #2





Group: Members
Posts: 1593
Joined: 24-March 02
From: Revere, MA
Member No.: 1607



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.

This post has been edited by HotshotGG: Mar 24 2010, 17:30


--------------------
College student/IT Assistant
Go to the top of the page
+Quote Post
shnutils
post Mar 24 2010, 20:18
Post #3





Group: Members
Posts: 50
Joined: 5-May 04
From: VA
Member No.: 13908



QUOTE (titox @ Mar 24 2010, 11:17) *
CODE
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:
  1. shntool can handle CUE sheets natively nowadays, just pass it on stdin or via the -f option.
  2. 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
shnsplit -f file.cue -o "flac flac -s -o %f -" file.wv
Go to the top of the page
+Quote Post
titox
post Mar 25 2010, 08:40
Post #4





Group: Members
Posts: 13
Joined: 9-February 10
Member No.: 78034



Thanks that's what I needed.

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

CODE
"flac flac paramters"



Is that correct?

Best
Tito


QUOTE (shnutils @ Mar 24 2010, 20:18) *
...snip...
Here is a sample showing both, using shntool's default flac encoding parameters. Tailor this as needed:

CODE
shnsplit -f file.cue -o "flac flac -s -o %f -" file.wv

Go to the top of the page
+Quote Post
shnutils
post Mar 26 2010, 07:34
Post #5





Group: Members
Posts: 50
Joined: 5-May 04
From: VA
Member No.: 13908



That is correct!
Go to the top of the page
+Quote Post
TA123
post Aug 3 2010, 23:51
Post #6





Group: Members
Posts: 17
Joined: 9-March 06
Member No.: 28369



I've got the following error trying to do it:
CODE
:~/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.

This post has been edited by TA123: Aug 3 2010, 23:54
Go to the top of the page
+Quote Post
Takla
post Aug 4 2010, 00:03
Post #7





Group: Members
Posts: 169
Joined: 14-November 09
Member No.: 74931



CODE
#!/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/
Go to the top of the page
+Quote Post
imre_herceg
post Aug 4 2010, 00:43
Post #8





Group: Members
Posts: 44
Joined: 13-October 06
Member No.: 36310



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
Go to the top of the page
+Quote Post
TA123
post Aug 4 2010, 22:29
Post #9





Group: Members
Posts: 17
Joined: 9-March 06
Member No.: 28369



QUOTE (imre_herceg @ Aug 4 2010, 00:43) *
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
type object 'OpenFileError' has no attribute 'NotSupported'
Go to the top of the page
+Quote Post
TA123
post Aug 4 2010, 22:44
Post #10





Group: Members
Posts: 17
Joined: 9-March 06
Member No.: 28369



QUOTE (Takla @ Aug 4 2010, 00:03) *
CODE
#!/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
./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
Go to the top of the page
+Quote Post
Takla
post Aug 4 2010, 23:06
Post #11





Group: Members
Posts: 169
Joined: 14-November 09
Member No.: 74931



apt-cache show shntool

CODE
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
       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
$ apt-cache policy wavpack
CODE
$ apt-cache policy flac
CODE
$ apt-cache policy cuetools


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

This post has been edited by Takla: Aug 4 2010, 23:07
Go to the top of the page
+Quote Post
TA123
post Aug 5 2010, 14:28
Post #12





Group: Members
Posts: 17
Joined: 9-March 06
Member No.: 28369



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?

This post has been edited by Peter: Aug 5 2010, 15:35
Reason for edit: Removed pointless full quote of the previous post.
Go to the top of the page
+Quote Post
shnutils
post Aug 5 2010, 17:57
Post #13





Group: Members
Posts: 50
Joined: 5-May 04
From: VA
Member No.: 13908



QUOTE (TA123 @ Aug 5 2010, 09:28) *
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
% shntool info -DD file.wv
% shntool -v

Go to the top of the page
+Quote Post
bryant
post Aug 5 2010, 18:07
Post #14


WavPack Developer


Group: Developer (Donating)
Posts: 1287
Joined: 3-January 02
From: San Francisco CA
Member No.: 900



QUOTE (TA123 @ Aug 5 2010, 06:28) *
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)

This post has been edited by bryant: Aug 5 2010, 18:15
Go to the top of the page
+Quote Post
shnutils
post Aug 5 2010, 18:15
Post #15





Group: Members
Posts: 50
Joined: 5-May 04
From: VA
Member No.: 13908



QUOTE (bryant @ Aug 5 2010, 13:07) *
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
-i "wv wvunpack -q -y %f -o -"
Go to the top of the page
+Quote Post
bryant
post Aug 5 2010, 18:22
Post #16


WavPack Developer


Group: Developer (Donating)
Posts: 1287
Joined: 3-January 02
From: San Francisco CA
Member No.: 900



QUOTE (shnutils @ Aug 5 2010, 10: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! smile.gif
Go to the top of the page
+Quote Post
shnutils
post Aug 5 2010, 18:43
Post #17





Group: Members
Posts: 50
Joined: 5-May 04
From: VA
Member No.: 13908



QUOTE (bryant @ Aug 5 2010, 13:22) *
QUOTE (shnutils @ Aug 5 2010, 10: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! smile.gif

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

"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
  /* 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.   */

Go to the top of the page
+Quote Post
bryant
post Aug 5 2010, 20:29
Post #18


WavPack Developer


Group: Developer (Donating)
Posts: 1287
Joined: 3-January 02
From: San Francisco CA
Member No.: 900



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.

QUOTE (shnutils @ Aug 5 2010, 10:43) *
No problem, as I recall you made it easy for me by providing detection code. smile.gif
Ah yes, I remember that now! I'll have to make sure I don't break that code in the future! smile.gif

QUOTE (shnutils @ Aug 5 2010, 10:43) *
CODE
  /* 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.   */

smile.gif
Go to the top of the page
+Quote Post
TA123
post Aug 5 2010, 22:21
Post #19





Group: Members
Posts: 17
Joined: 9-March 06
Member No.: 28369



QUOTE (shnutils @ Aug 5 2010, 17:57) *


here you are:
CODE
$ 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
$ shntool -v
shntool 3.0.7
Copyright (C) 2000-2008 Jason Jordan <shnutils@freeshell.org>
Go to the top of the page
+Quote Post
shnutils
post Aug 5 2010, 22:59
Post #20





Group: Members
Posts: 50
Joined: 5-May 04
From: VA
Member No.: 13908



QUOTE (TA123 @ Aug 5 2010, 17:21) *
here you are:
CODE
$ 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+.

QUOTE (TA123 @ Aug 5 2010, 17:21) *
CODE
$ 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.
Go to the top of the page
+Quote Post
ptrkmj
post May 27 2012, 11:14
Post #21





Group: Members
Posts: 2
Joined: 27-May 12
Member No.: 100193



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
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 18th April 2014 - 07:08