Jump to content

XML:SNDD: Difference between revisions

309 bytes removed ,  24 February 2023
m
wording
(replaced old music scripting section with new one, correcting various information in the process)
m (wording)
Line 37: Line 37:
  ffmpeg -i input.wav -acodec adpcm_ima_qt -ar 22050 output.aif
  ffmpeg -i input.wav -acodec adpcm_ima_qt -ar 22050 output.aif


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:
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 Unix shell script for converting a folder of sounds from WAV to the AIFF format suitable for importing:


  #!/bin/sh<br />
  #!/bin/sh<br />
Line 54: Line 54:


==The .aif suffix==
==The .aif suffix==
When you are replacing existing Oni sounds, note that all of Oni's SNDD resources possess a ".aif" suffix as part of their <u>actual resource names</u> (yes, even the WAV-encoded sounds in Windows Oni). So if you import them with a name like "SNDDgears.aif", the file suffix gets changed to ".oni" upon import by OniSplit, and you end up with a resource simply titled "SNDDgears" in-game. Oni will look for a sound titled "SNDDgears.aif", and nothing will play. Hence, you want to title an AIFF file "SNDDgears.aif.aif" and a WAV file "SNDDgears.aif.wav" OniSplit will produce the file "SNDDgears.aif.oni" upon importing it, which in turn provides the resource named "SNDDgears.aif" that Oni desires.
When you are replacing existing Oni sounds, note that all of Oni's SNDD resources possess a ".aif" suffix as part of their <u>actual resource names</u> (yes, even the WAV-encoded sounds in Windows Oni). So if you import them with a name like "SNDDgears.aif", the file suffix gets changed to ".oni" upon import by OniSplit, and you end up with a resource simply titled "SNDDgears" in-game. Existing resources in Oni link to a sound titled "SNDDgears.aif", thus nothing will play. If you supply an AIFF file called "SNDDgears.aif.aif" or a WAV file called "SNDDgears.aif.wav", OniSplit will create the file "SNDDgears.aif.oni", and upon importing it, Oni will find the resource named "SNDDgears.aif" that it's seeking.


==.oni file creation==
==.oni file creation==
Line 64: Line 64:
* Target Platform: choose the desired mode
* Target Platform: choose the desired mode
* Tools > Sound Wizard
* Tools > Sound Wizard
===Via batch file===
'''SNDD for Windows'''
onisplit -create output_Win_files input/*.wav
onisplit -create output_Win_files input/*.xml
pause
'''SNDD for Mac'''
onisplit -create output_Mac_files input/*.aif
onisplit -create output_Mac_files input/*.aiff
onisplit -create output_Mac_files input/*.afc
onisplit -create output_Mac_files input/*.xml
pause


===Via command line===
===Via command line===
For those who want to do it on their own.
For those who want to do it on their own.


OniSplit
: OniSplit.exe -create output_directory_'''Mac''' input_directory/'''*.aif'''
: -create output_directory_'''Mac''' input_directory/'''*.aif'''
: OniSplit.exe -create output_directory_'''Win''' input_directory/'''*.wav'''
: -create output_directory_'''Win''' input_directory/'''*.wav'''
: OniSplit.exe -create output_directory input_directory/*.xml
: -create output_directory input_directory/*.xml
For simplicity's sake you can give them all the same base name, assuming you have only one sound:
: <font color=#AAAAAA>SNDD</font>yourfile<font color=#AAAAAA>.oni</font>
: <font color=#AAAAAA>OSBD</font>yourfile<font color=#AAAAAA>'''.grp'''.oni</font>
: <font color=#AAAAAA>OSBD</font>yourfile<font color=#AAAAAA>'''.amb'''.oni</font>


==OSBD information==
==OSBD information==
Line 94: Line 76:


* OSBD*.'''amb'''
* OSBD*.'''amb'''
** music (call OSBD from BSL)
** music (call the OSBD from BSL)
** dialogue (call OSBD from BSL)
** dialogue (call the OSBD from BSL)
** [[XML:BINA/PAR3|BINA3RAP]] <AmbientSound> (action type)
** [[XML:BINA/PAR3|BINA3RAP]] <AmbientSound> (action type)
** [[#BINACJBOSound.xml|BINACJBOSound.xml]] (area-fixed sounds)
** [[#BINACJBOSound.xml|BINACJBOSound.xml]] (area-fixed sounds)
Line 111: Line 93:
** [[XML:TRIG|TRIG]] <TriggerSound>
** [[XML:TRIG|TRIG]] <TriggerSound>


For simplicity's sake you should follow Oni's example and give all the files related to one sound the same base name:
: <font color=#AAAAAA>SNDD</font>yourfile<font color=#AAAAAA>.oni</font>
: <font color=#AAAAAA>OSBD</font>yourfile<font color=#AAAAAA>'''.grp'''.oni</font>
: <font color=#AAAAAA>OSBD</font>yourfile<font color=#AAAAAA>'''.amb'''.oni</font>


'''Details on music'''
===Music .ambs===
: OSBD_newmusic.amb.oni (The main file — links to the group, intro and ending files)
: OSBD_newmusic.amb.oni (the main file — links to the group, intro and ending files)
: OSBD_newmusic.grp.oni (Links to the music files)
: OSBD_newmusic.grp.oni (links to the music files)
: OSBD_newmusic_in.grp.oni (Links to intro part of the music — optional)
: OSBD_newmusic_in.grp.oni (links to intro part of the music — optional)
: OSBD_newmusic_out.grp.oni (Links to the ending of the music — optional)
: OSBD_newmusic_out.grp.oni (links to the ending of the music — optional)
: SNDD_newmusic1.oni (The individual music files; it's best to break up the music into segments of perhaps 30 secs to a minute each — Oni may crash or become sluggish if you use a single file for the music)
: SNDD_newmusic1.oni, SNDD_newmusic2.oni… (the individual music files)


Breaking the main loop of the music into parts allows Oni to more smoothly transition to the ending part when necessary; the amount of time that a track will play cannot be predicted, after all, since players will take varying amounts of time to clear that segment of the level.
Breaking the main loop of the music into parts allows Oni to more quickly transition to the ending part when the music is commanded to stop playing. The shorter segments you can break the music into, the better – both for the sake of reaching the outro sooner, and because long segments can be taxing on the game. Oni's music averages 9 seconds per segment, and a segment rarely goes above 20 seconds.


The parts of the music between intro and outro are played in a randomized order, probably to add more variety to the playback. Note that .grp files have a <Weight> tag under each <Permutation>. As with TRAC's <Weight> field, this can be used to set the relative probability that a music segment will be picked. Each permutation's weight is figured in relation to the total weight of all segments, so if a piece of music has four permutations and the first one has a <Weight> of 30 and the other three have <Weight>s of 10, the first segment has a 50% chance of being played. This feature is effectively unused in Oni's music, as all music OSBDs assign a weight of 10 to all <Permutation>s.
The parts of the music between intro and outro are played in a randomized order to add more variety to the playback. Note that .grp files have a <Weight> tag under each <Permutation>. As with TRAC's <Weight> field, this can be used to set the relative probability that a music segment will be picked. Each permutation's weight is figured in relation to the total weight of all segments, so if a piece of music has four permutations and the first one has a <Weight> of 30 and the other three have <Weight>s of 10, the first segment has a 50% chance of being played. This feature is effectively unused in Oni's music, as all music OSBDs assign a weight of 10 to all <Permutation>s.


===OSBDfile.imp.xml===
===OSBDfile.imp.xml===
Line 428: Line 414:


==BINACJBOSound.xml==
==BINACJBOSound.xml==
This is for sounds fixed to a certain area.
This is for sounds anchored to a certain area.


{| class="wikitable" width=100%
{| class="wikitable" width=100%
Line 539: Line 525:
See [http://oni.bungie.org/forum/viewtopic.php?id=798 here].
See [http://oni.bungie.org/forum/viewtopic.php?id=798 here].


==How to register sounds to characters==
==How to register sounds for characters==
...such as the sounds of heavy attacks and taunts.
...such as the sounds of heavy attacks and taunts.