shnsplit: error: m:ss.ff format can only be used with CD-quality files (solution)
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
shnsplit: error: m:ss.ff format can only be used with CD-quality files (solution)
OK, I'm posting a problem AND a solution I found, seeing that I couldn't find it anywhere.
True, reading the manual helps, but in this particular case it takes a little bit more than just reading the manual, and some people feel more at ease with programs, than others do...
Anyway.
Suppose somebody ripped a vinil LP using M$ Win ripping software and generously shared his file in *wv (or *ape or other) format with the community.
So when dealing with a single *ape or *wv file you download from Internet, which you want to split into single tracks using the *CUE file (which you also downloaded), the command you find on various online HOWTOs and guides is as follows (using Linux cuetools and shntool packages, via `yum/apt-get install shntool cuetoos`):
This must split the existing *wv single file into single tracks using the supplied CUE file. And it works fine in most cases, when your *wv (or *ape or whatever) file is CD-quality. Otherwise you CAN get this message:
Quote:
shnsplit: error: m:ss.ff format can only be used with CD-quality files
The above is not the only way to use shntools to split a single file, but once you get the above format error message, you'll get it no matter what shntool command you issue.
As I understood after a whole day of intense thinking, the root of the problem is in the supplied CUE file:
So the cuebreakpoints command itself shows the format of time for each track as used in the CUE sheet. Here it is in the format, which shntool understands to be a m:ss.ff format, and that is supported only for CD-quality files, and the one you downloaded obviously is not, given the message...
Well, perhaps, the last 2 digits DON'T mean frames, as shntool assumes it, but anyway all we need is just to change the format of the strings to match the m:ss.nnn format for shntool to accept it! This can be done by adding a "0" to each time string, which will put it, in effect, in the desired m:ss.nnn format:
Code:
cuebreakpoints $MYFILE.cue | sed s/$/0/ | shnsplit -o flac $MYFILE.wv
(sure I tried a couple of other sed substitutions, before I came to this most simple one, the only one that worked for me )
This time no complains issued and shnsplit peacefully splits the file into tracks and does it OK. Hope this helps!
NOTE:I'm posting this because I only found this issue in a couple of forums and the "best" solution supplied was to use various gimmicky M$ software under Windows to solve the problem, even to install some in WINE!!!
However, using M$ Win stuff & WINE is the last resort ever, especially when the problem is simply in the right usage of the linux software.
I communicated directly with the author of shntools. He gave me an equation for converting to frames: nnn = (ff / 75) * 1000
If this conversion is performed on the time stamps shnsplit will have no problem with them (and your solution does the math wrong so the splits will be off by some possibly noticeable margin).
I have been trying to sort out how to use this equation to either create a new cue sheet with the corrected time values, or to incorporate it into my splitting script:
Your equation converts, it seems, frames in a (ff) format to fractions of seconds (nnn). Nice to know, thank you! I must try this out as well...
However, in my post I explained my assumption, that in the cue sheet I had received the last two digits 33:02.69 DIDN'T actually mean frames in (ff) format, as shntools were built to assume, but fractions of seconds in (nn) format instead. As I was trying to split a *.wv file created by WVPACK software, my assumption is further supported by what is found on WVPACK page here:
Quote:
--skip=[sample|hh:mm:ss.ss] = start decoding at specified sample/time
Specifies an alternate start position for decoding, as either an integer sample index or as a time in hours, minutes, and seconds (with fraction). The WavPack file must be seekable (i.e. not a pipe). This option can be used with the --until option to decode a specific region of a track.
Obviously, in the example above the format like 33.46 means ss.ss and not ss.ff, as shntools will presume...
Let's not forget, too, that the ripping software is usually MS Windows based and doesn't necessarily conform to the shntools standards of format. There's been more than one such case reported... So I mean, your equation must be correct for converting of ff > nnn, while my assumption about the difference in formats need not be overlooked as well.
And thank you for your reply ).
So you might want to take this consideration into account while trying to automate the process. Wishing you all the best ))
Right, all the info on CUEs that I could find mentioned only this format you're posting in your post...
Just recently I dealt with this same format trying to rip a musical DVD into separate audio files to use them on my portable.
Had problems, until finally used the package dvd::rip for Linux. That did it all in a GUI.
kosty, your solution is incorrect. Frames are 1/75's of second, so 33:02.69 is valid trackpoint. Ifyou want precision you must convert these values into sample count and use byte notation.
I.e.
Great thanks for another calculation help.
But did you actually read #4 above?
You are right: 0.69 can stand for frames (that is, 69/75), yet it could as well be 0.69 seconds (69/100). I assumed the latter after reading the manual of the program that produced the CUE sheet. It doesn't have among its options the possibility to output trackpoints in fractions of frames. But if you have reasons to believe it actually could and did, please, let me know.
Thanks a lot .
SO...
I thank everyone for submitting such data that it was rather difficult to find by simple googling.
It is also good to have it all in one place, which was the original purpose of this post.
So here we have:
1)
Quote:
nnn = (ff/75) * 1000
This helps to switch between <nnn> fractions of seconds and <ff> of frames.
Helps if you need to convert from <ss.ss> to <ss.fff> etc. Thanks to jamesisin.
2) general reference for the values used in audio decoding/encoding:
I know this thread is quite old but would be super grateful if someone could help with this:
I have a .flac file that's pretty big: approx 1.6 Gig The file plays 100% from start to finish! I want to split the file but when I use the standard way of doing things:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.