kuwacom commited on
Commit
6c3b1b5
1 Parent(s): 5b78765

add: datasetを変換するスクリプト

Browse files
Files changed (2) hide show
  1. cut-audio.bat +17 -0
  2. cut-audio.sh +12 -0
cut-audio.bat ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @echo off
2
+ setlocal enabledelayedexpansion
3
+
4
+ set "input_directory=./input"
5
+ set "output_directory=./output"
6
+ set "input_extension=.mp4"
7
+ set "output_extension=.wav"
8
+
9
+ for %%i in ("%input_directory%\*%input_extension%") do (
10
+ set "input_file=%%i"
11
+ set "output_file=!output_directory!\!input_file:%input_directory%\=!"
12
+ set "output_file=!output_file:%input_extension%=%output_extension%!"
13
+ ffmpeg -i "!input_file!" -c:a pcm_f32le "!output_file!"
14
+ )
15
+ @REM -c:a pcm_f32le webm を wav にする
16
+
17
+ endlocal
cut-audio.sh ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ input_directory="./input"
4
+ output_directory="./output"
5
+ input_extension=".mp4"
6
+ output_extension=".wav"
7
+
8
+ for input_file in "$input_directory"/*"$input_extension"; do
9
+ output_file="$output_directory/$(basename "${input_file%$input_extension}")$output_extension"
10
+ ffmpeg -i "$input_file" -c:a pcm_f32le "$output_file"
11
+ done
12
+ # -c:a pcm_f32le は webm を wav にする