File: generate-iOS-WAVs.sh

package info (click to toggle)
frogatto-data 1.3.1%2Bdfsg-3
  • links: PTS, VCS
  • area: non-free
  • in suites: bookworm, bullseye
  • size: 254,432 kB
  • sloc: xml: 584; python: 396; perl: 249; sh: 126; ruby: 69; makefile: 30
file content (20 lines) | stat: -rw-r--r-- 818 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
# this script uses ffmpeg to convert all of our ogg/wav sound effects to the exact wav format amenable to the iPhone's audio coprocessor.
# cwd should be the base of the git repo
# you'll naturally need to compile ffmpeg, which at the time of this writing, also requires yasm

src_directory="./sounds"
dst_directory="./sounds_wav"
ffmpeg_settings="-ac 1 -ar 44100 -acodec pcm_s16le"
if [ -d $src_directory ] && [ -d $dst_directory ]; then
	for f in $( find $src_directory ); do
		destfile=( `echo $f | sed 's/sounds/sounds_wav/' | sed 's/\.[^.]*$//'`.wav );
		if [ ! -d `dirname $destfile` ]; then
			#echo "dir doesn't exist:" `dirname $destfile`;
			mkdir `dirname $destfile`;
		fi
		#the regex in the `` code will replace any file extension with wav
		ffmpeg -i $f $ffmpeg_settings $destfile;
	done
fi