rename audio module
This commit is contained in:
parent
16a3443297
commit
f1bfd78f4b
3 changed files with 2 additions and 2 deletions
20
modules/transcode.nix
Normal file
20
modules/transcode.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
ffmpeg
|
||||
];
|
||||
|
||||
programs.zsh.initContent = ''
|
||||
function flac2aac() {
|
||||
local dir="''${1:-.}"
|
||||
for f in "$dir"/**/*.flac; do
|
||||
if [[ -f "$f" ]]; then
|
||||
local outfile="./transcode/''${f%.flac}.m4a"
|
||||
mkdir -p "$(dirname "$outfile")"
|
||||
ffmpeg -i "$f" -vn -c:a aac -b:a 256k -movflags +faststart "$outfile"
|
||||
fi
|
||||
done
|
||||
}
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue