add function for splitting cue sheets
This commit is contained in:
parent
ad42cb50e4
commit
2a1db299c8
1 changed files with 19 additions and 0 deletions
|
|
@ -3,6 +3,8 @@
|
|||
{
|
||||
home.packages = with pkgs; [
|
||||
ffmpeg
|
||||
shntool
|
||||
cuetools
|
||||
];
|
||||
|
||||
programs.zsh.initContent = ''
|
||||
|
|
@ -31,5 +33,22 @@
|
|||
fi
|
||||
done
|
||||
}
|
||||
|
||||
function cuesplit() {
|
||||
local audio="$1"
|
||||
local cue="''${2:-''${audio%.*}.cue}"
|
||||
if [[ ! -f "$audio" ]]; then
|
||||
echo "Audio file not found: $audio" >&2
|
||||
return 1
|
||||
fi
|
||||
if [[ ! -f "$cue" ]]; then
|
||||
echo "Cue file not found: $cue" >&2
|
||||
return 1
|
||||
fi
|
||||
local ext="''${audio##*.}"
|
||||
local fmt="''${ext:l}"
|
||||
mkdir -p ./tracks
|
||||
shnsplit -f "$cue" -t "%n - %t" -o "$fmt" -d ./tracks "$audio"
|
||||
}
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue