IPB

Welcome Guest ( Log In | Register )

2 Pages V  < 1 2  
Reply to this topicStart new topic
Help with shntool !, need to create a cuesheet file from existing WAV file
krafty
post Aug 26 2011, 16:56
Post #26





Group: Members
Posts: 241
Joined: 20-March 10
Member No.: 79175



To work as expected in Nautilus, the following code needed to be inserted:
This will prevent Nautilus to do its operations from $HOME as it usually does.
What remains unclear to me is that if Dolphin supports those kind of scripts or some magic...

The script needs to be executable and inside .gnome2/nautilus-scripts

CODE
#!/usr/bin/env bash

            # Go to file's directory if it's a file, for Nautilus

            if [ ! -d "$destination" ]; then
                destination="`dirname "$destination"`"
            fi
      
FILE=`basename $1`
FILENOEXT=`basename $1 .flac`

sox -S -V $destination/$FILE -c 2 stereo.wav

shntool split -l 5:00 stereo.wav

shntool cue split-track*.wav >> $FILENOEXT.cue

rm split-track*.wav
rm stereo.wav

sed -i "s#joined.wav#$FILE#" $FILENOEXT.cue

Go to the top of the page
+Quote Post
krafty
post Aug 26 2011, 22:32
Post #27





Group: Members
Posts: 241
Joined: 20-March 10
Member No.: 79175



dutch109:

how do I properly do a for loop here, getting $i from "TRACK" statement, but putting the TITLE and PERFORMER idented and after INDEXes statements?

CODE
for i in $FILENOEXT.cue do
sed -i "s/^\([ \t]*\)\(INDEX 01.*\)$/\1\2\n\1TITLE Part $i\n\1PERFORMER Conferencist/" $FILENOEXT.cue
done


This post has been edited by krafty: Aug 26 2011, 22:32
Go to the top of the page
+Quote Post
krafty
post Aug 27 2011, 00:01
Post #28





Group: Members
Posts: 241
Joined: 20-March 10
Member No.: 79175



CODE
konsole --title="Create CUESHEET" -e $SHELL -c "cd %d; mscd %f"


I found out that this statement will work in KDE/Dolphin when Opening the file with the associated script.

Now the issue is, file name with spaces... aren't being processed. Any tips would help!
Go to the top of the page
+Quote Post
krafty
post Aug 27 2011, 19:39
Post #29





Group: Members
Posts: 241
Joined: 20-March 10
Member No.: 79175



A much better worked out version of the script:

CODE
#!/usr/bin/env bash

if [[ $1 = */* ]]; then cd "${1%/*}" || exit; fi


file=${1##*/}
base=${file%.*}

sox -S -V "$file" -c 2 stereo.wav

shntool split -l 5:00 stereo.wav

{
echo "REM DATE 2011";
echo "REM GENRE Rock";
echo "REM COMMENT CD-R";
echo "PERFORMER \"Band\"";
echo "TITLE \"Album\"";
shntool cue split-track*.wav | sed "s#joined.wav#$file#";
} > "$base.cue"

rm split-track*.wav
rm stereo.wav



Update: Found out a way to work with Nautilus launching on terminal, the custom command should be:

CODE
gnome-terminal --title="Creating Cuesheet for CD..." --hide-menubar -x mscd %f


This post has been edited by krafty: Aug 27 2011, 20:16
Go to the top of the page
+Quote Post

2 Pages V  < 1 2
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: 20th May 2013 - 20:22