You are not logged in.

#1 2010-02-04 10:13:42

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

split flac/cue file into different tracks

Hello guys,

I got a music album from a friend of mine but it consists only of one .flac and one .cue file. I can play the .flac file with mocp but that's the whole album, with its complete duration on one track. How can I split this into its different tracks?

Thank you in advance. smile

Best regards

orschiro

Last edited by orschiro (2010-02-04 10:14:07)

Offline

#2 2010-02-04 10:35:00

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: split flac/cue file into different tracks

How about searching the forums for "split flac", that's what i did and it worked out great.

(p.s., love your site design wink)


ᶘ ᵒᴥᵒᶅ

Offline

#3 2010-02-04 17:17:57

ezzetabi
Member
Registered: 2006-08-27
Posts: 947

Re: split flac/cue file into different tracks

This is what I did:
http://appdb.winehq.org/objectManager.p … n&iId=4696

the test is mine and it works well: flac -> wav -> split -> flac again.
I did not test with a newer version of Wine, but I cannot imagine it does not work anymore.

Offline

#4 2010-02-04 17:40:04

humanzoo
Member
Registered: 2007-10-14
Posts: 28

Re: split flac/cue file into different tracks

These instructions have served me well for awhile:

http://stillstup.blogspot.com/2008/07/s … av-by.html

Pretty much all the software involved is available in pacman or AUR.

Offline

#5 2010-02-05 09:02:45

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

Re: split flac/cue file into different tracks

Hello guys,

thank you for your answers. Especially humanzoo's link was very good.

It's pretty easy. Just do the following:

1) Install shntool and cuetools from AUR
2) Go to the directory where the flac and the cue file is and run

shntool split -f *.cue -o flac *.flac

The output should be different split-track*.flac files. Note that the first one might be waste and should be deleted.

3) Then run cuetag.sh *.cue split-track*.flac to write all necessary information such as track title into the splitted tracks. That's it. smile

Best regards

Offline

#6 2010-02-05 10:24:04

mcsaba77
Member
From: Ho Chi Minh City, Vietnam
Registered: 2009-09-30
Posts: 52

Re: split flac/cue file into different tracks

you can also convert them to mp3 (preset-extreme will give you considerable file size reduction without audible quality loss) or ogg then use mp3split. I use this simple script:

#/bin/sh!
echo "split.sh <cuefile> <audiofile - mp3 or ogg>"
mp3splt -a -c "$1" "$2" -o @n-@b\ -\ @a-@p-@t

That would properly tag your mp3 files with the info from the .cue file

Offline

#7 2010-02-05 11:36:56

owain
Member
Registered: 2009-08-24
Posts: 251

Re: split flac/cue file into different tracks

A handy script I picked up from somewhere, possibly the Ubuntu forums:

#!/bin/sh

# frontend for:            cuetools, shntool, mp3splt
# optional dependencies:    flac, mac, wavpack

SDIR=`pwd`

if [ "$1" = "" ]
  then
    DIR=$SDIR
else
    case $1 in
        -h | --help )
            echo "Usage: cuesplit [Path]"
            echo "       The default path is the current directory."
            exit
            ;;
        * )
        DIR=$1
    esac
fi

echo -e "\

Directory: $DIR
________________________________________
"
cd "$DIR"
TYPE=`ls -t1`

case $TYPE in
    *.ape*)
        cuebreakpoints *.cue | shnsplit -a track -o flac *.ape
        cuetag.sh *.cue track*.flac
        exit
        ;;

    *.flac*)
        cuebreakpoints *.cue | shnsplit -a track -o flac *.flac
        cuetag.sh *.cue track*.flac
        exit
        ;;

    *.mp3*)
        mp3splt -no "@n @p - @t (split)" -c *.cue *.mp3
        cuetag.sh *.cue *split\).mp3
        exit
        ;;

    *.ogg*)
        mp3splt -no "@n @p - @t (split)" -c *.cue *.ogg
        cuetag.sh *.cue *split\).ogg
        exit
        ;;

    *.wv*)
        cuebreakpoints *.cue | shnsplit -a track -o flac *.wv
        cuetag.sh *.cue track*.flac
        exit
        ;;

    *.wav*)
        cuebreakpoints *.cue | shnsplit -a track -o flac *.wav
        cuetag.sh *.cue track*.flac
        exit
        ;;

    * )
    echo "Error: Found no files to split!"
    echo "       --> APE, FLAC, MP3, OGG, WV, WAV"
esac
exit

Offline

#8 2010-02-05 12:53:45

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: split flac/cue file into different tracks

yes well, there are already a dozen pre-fab scripts right here on the forums:

Got full-album-length ape/flac/tta files? Want split them? Here you go
splitting flac albums with automatic tagging
etc.

but apparently people are more interested in reinventing the wheel / rewriting the story each time, oh well.


ᶘ ᵒᴥᵒᶅ

Offline

#9 2010-02-05 13:32:20

Zeist
Arch Linux f@h Team Member
Registered: 2008-07-04
Posts: 532

Re: split flac/cue file into different tracks

mcsaba77 wrote:

you can also convert them to mp3 (preset-extreme will give you considerable file size reduction without audible quality loss)

I'm not going to start an argument about this here, but the quality loss being audible or not is a subjective thing rather than a fact.


I haven't lost my mind; I have a tape back-up somewhere.
Twitter

Offline

#10 2010-02-09 22:18:22

ftrvxmtrx
Member
Registered: 2010-02-09
Posts: 1

Re: split flac/cue file into different tracks

Offline

#11 2010-03-29 21:11:06

EnterTheDragon2007
Member
Registered: 2007-06-03
Posts: 11

Re: split flac/cue file into different tracks

solution is gCue2tracks with GUI the link is

http://aur.archlinux.org/packages.php?ID=23024

Dependencies  cuetools  ffmpeg pygtk shntool  unzip -------> install these first form AUR

Offline

#12 2011-02-14 18:36:44

artbz
Member
From: Ukraine, Kyiv
Registered: 2011-02-14
Posts: 1

Re: split flac/cue file into different tracks

Here is my solution to splitting a flac file with a corresponding cue file, shntool and flac encoder.
You should have shntool and flac installed. I tested this solution only with shntool-v3.0.10 and flac-v1.2.1 therefore I can't promise that it will work with a lower versions of these programs.

The spell is:

shntool split -f $CUEFILE -o 'flac flac --output-name=%f -' -t '%n-%p-%t' $ORIGINALFLAC

Where:

  • $CUEFILE - path to your .cue file

  • -o 'flac flac --output-name=%f -' - specifies output format. It says - output to flac format using flac encoder, output file name will be specified by shntool and input will come not from the file but rather from outside, through a pipe or standard input(stdin).

  • -t '%n-%p-%t' - specifies a template for the names of split files which shntool will provide to codec program. To find out what do '%n', '%p' and '%t' mean look into 'man shntool'

  • $ORIGINALFLAC - path to your original everything-in-one .flac file

You can supply additional arguments like compression rate to the encoder by adding them analogous to --output-name parameter.

Last edited by artbz (2011-02-14 18:39:37)

Offline

#13 2014-04-03 01:09:10

pierregermain
Member
From: Mty - Par - Mad - Fra
Registered: 2013-11-28
Posts: 10
Website

Re: split flac/cue file into different tracks

I had strange chars in my path ... so i made this little script based on your one liner.
Thanks!

#!/bin/bash
#Arg 1 is cue file
#Arg 2 is orginal flac file

if [ "$#" -ne 2 ]; then
    echo "Illegal number of parameters"
    echo "Sintax:"
    echo "cue2flacs.sh cuefile flacFile"
    exit 0
fi

echo "copy a temp cue file ..."
cp "$1" ./tmp.cue

echo "copy a temp flac file ..."
cp "$2" ./tmp.flac

shntool split -f "./tmp.cue" -o 'flac flac --output-name=%f -' -t '%n-%p-%t' "./tmp.flac"

echo "now I will delete the temp cue file ..."
rm ./tmp.cue

echo "now I will delete the temp flac file ..."
rm ./tmp.flac

echo "Do you want to delete the orignal flac ?"
rm -i "$2"

Last edited by pierregermain (2014-04-03 01:47:17)

Offline

#14 2014-04-03 03:29:51

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,740

Re: split flac/cue file into different tracks

pierregermain,  Glad it is working for you, and thanks for the script.   But...  This is a three year old thread, so I am going to go ahead a close it.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB