Skip to content

Commit e65a440

Browse files
committed
Add script to find the audio durarion
1 parent 46adcaf commit e65a440

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

audio.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## Script to find the total audio duration in the speech corpus
2+
3+
webm format in ./audio does not have headers with duration information
4+
Run the following script to copy the stored audio to a format with duration information and find the total duration in HH:MM:SS format.
5+
6+
```
7+
mkdir newaudio/
8+
cd audio/
9+
for f in *; do ffmpeg -i $f -acodec copy ../newaudio/$f ; done
10+
cd ../newaudio/
11+
for f in *; do ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 $f ; done | awk '{SUM += $1} END { printf "%d:%d:%d\n",SUM/3600,SUM%3600/60,SUM%60}'
12+
```

0 commit comments

Comments
 (0)