18,700
edits
Paradox-01 (talk | contribs) m (emphasizing importance of sound subtype by making it bold: it must PCM/MS-ADPCM and ima4) |
(→Source file creation: rewrite explaining how to batch-convert on Macs, and the necessity of the ".aif.aif" suffix) |
||
Line 16: | Line 16: | ||
==Source file creation== | ==Source file creation== | ||
In Windows, SNDDs use WAV as their internal data format, but on Macs the AIFF format is used. Here are the details: | |||
{|class="wikitable" width="100%" | {|class="wikitable" width="100%" | ||
! | ! Windows | ||
! | ! Mac | ||
|- | |- | ||
|width=50% valign=top| | |width=50% valign=top| | ||
Line 32: | Line 32: | ||
|} | |} | ||
To create suitable files for importing into Oni using a GUI program, you could use [http://audacity.sourceforge.net/download/beta_windows#recdown Audacity] and its [http://manual.audacityteam.org/index.php?title=FAQ:Installation_and_Plug-Ins#installffmpeg ffmpeg Export Library]. After you've installed Audacity and the ffmpeg library, go to '''Edit > Preferences... > Libraries''', click the Locate... button and find the installed library file. Open your sound file then go to '''File > Export... > Save As: ''yourfile.<font color="#CC0000">wav</font>'''''; Format: Custom FFmpeg Export; Options... > wav; '''pcm_s16le'''; Sample Rate: 22050; OK and save the file (adpcm_ms doesn't work as of Audacity 1.3 Beta). | |||
[http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/Audacity.png http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/Audacity_tn.png] | |||
If you want to convert sounds into the AIFF format for Macs, the major catch with Audacity is that its batch processing feature does not support AIFF exporting even though it's a part of the underlying ffmpeg program that Audacity uses. To convert a large number of sound files, you can install ffmpeg using your package manager of choice (MacPorts, Homebrew, etc.). Building can take a while, but you can also find pre-built ffmpeg binaries around the Web fairly easily. The basic command you want to use is: | |||
ffmpeg -i input.wav -acodec adpcm_ima_qt -ar 22050 output.aif | |||
Note that the order of arguments is critical: the rate and encoding are being applied to the outputted file, whereas if they came before the input file's name they would be instructions on how to read the input sound. Here is a simple shell script for converting a folder of sounds from WAV to the AIFF format suitable for importing: | |||
#!/bin/sh<br /> | |||
IFS=" | |||
"<br /> | |||
IN_DIR="/path/to/SNDD-wav" | |||
OUT_DIR="/path/to/SNDD-aif" | |||
for WAV in `find $IN_DIR | grep .wav$ ` | |||
do | |||
FILENAME=$(basename "$WAV") | |||
echo "Converting $FILENAME to IMA-compressed AIFF..." | |||
ffmpeg -i "$IN_DIR/$FILENAME" -acodec adpcm_ima_qt -ar 22050 "$OUT_DIR/${FILENAME%.wav}$aif.aif" | |||
done | |||
Note the double ".aif" suffix applied to the outputted files. This is necessary due to Oni's sounds possessing a ".aif" suffix as part of their <u>actual resource names</u> (even the WAV-encoded Windows sounds). So if you import them with a name like "SNDDgears.aif", the file suffix gets changed to ".oni" upon import, and you end up with a resource simply titled "SNDDgears" in-game. Oni will be looking for a sound titled "SNDDgears.aif", and won't find it. Hence, we title the AIFF file "SNDDgears.aif.aif" so that OniSplit yields "SNDDgears.aif.oni" upon importing, which in turn produces the resource named "SNDDgears.aif" that Oni desires. | |||
==Oni file creation== | ==Oni file creation== |