Skip to content

Instantly share code, notes, and snippets.

@mamemomonga
Created December 11, 2022 00:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mamemomonga/bc2868ab8a2f86e42f67b6381d057899 to your computer and use it in GitHub Desktop.
Save mamemomonga/bc2868ab8a2f86e42f67b6381d057899 to your computer and use it in GitHub Desktop.
KORG Gadget2 -> SP-404MK2 インポート補助ツール: このファイルと同じところに置かれた全てのWAVファイルをffmpegを通して1階層上のIMPORTフォルダに出力する
#!/usr/bin/env perl
# ---------------------------------------------
# このファイルと同じところに置かれた全てのWAVファイルを
# ffmpegを通して1階層上のIMPORTフォルダに出力する
# ---------------------------------------------
use strict;
use warnings;
use Cwd 'getcwd';
use feature 'say';
use File::Basename;
use Data::Dumper;
use File::Spec;
my $ffmpeg='ffmpeg';
my $basedir=dirname(File::Spec->rel2abs($0));
chdir($basedir);
my @files=glob('*.wav');
foreach my $fn(@files) {
my $fnd=File::Spec->catfile('../IMPORT','(E)'.$fn);
say "$fn -> $fnd";
system($ffmpeg,'-i',$fn,'-vn',$fnd);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment