OBD:SNDD: Difference between revisions

m
(moving around and polishing; will fill in OniSplit version after commit (pending))
Line 184: Line 184:
|}
|}
{{divhide|end}}
{{divhide|end}}
By looking at the end of the Mac/demo SNDDs (or the exported AIFF files), it can be confirmed that the extraneous samples are actually there, at the end of the last two 34-byte blocks (last Left block and last Right block). Unless the Mac and/or PC demo engines have a very non-standard implementation of IMA4 ADPCM, there is no way to interrupt playback for the lask blocks by cutting off the trailing samples (because they are no different from regular smaples). This is one of the aspects that impact seamless playback of sequences (music or ambient tracks), see "looping issues" below.
By looking at the end of the Mac/demo SNDDs (or the exported AIFF files), it can be confirmed that the extraneous samples are actually there, at the end of the last two 34-byte blocks (last Left block and last Right block). Unless the Mac and/or PC demo engines have a very non-standard implementation of IMA4 ADPCM, there is no way to interrupt playback for the last blocks by cutting off the trailing samples (because they are no different from regular samples). This is one of the aspects that impact seamless playback of sequences (music or ambient tracks), see "looping issues" below.


Possibly Mac/demo Oni just looks at the approximate length of each SNDD in frames (or game ticks, i.e., 1/60th of a second), which is listed in each SNDD's header and, once the announced frame count has been reached for the currently playing sound, starts playback on the next sound in the sequence. Depending on the hardware/software implementation of the audio pipelines, this logic can either interrupt the currently playing sound, or cause a slight overlap/crossfade between the current sound and the next. It is possible that PC retail Oni actually does the same, i.e., segments of a sequence are dispatched to the OS based on the frame count of the previous segment, rather than based on its actual play time (sample count). The early interrupt/crossfade is barely noticeable.
Possibly Mac/demo Oni just looks at the approximate length of each SNDD in frames (or game ticks, i.e., 1/60th of a second), which is listed in each SNDD's header and, once the announced frame count has been reached for the currently playing sound, starts playback on the next sound in the sequence. Depending on the hardware/software implementation of the audio pipelines, this logic can either interrupt the currently playing sound, or cause a slight overlap/crossfade between the current sound and the next. It is possible that PC retail Oni actually does the same, i.e., segments of a sequence are dispatched to the OS based on the frame count of the previous segment, rather than based on its actual play time (sample count). The early interrupt/crossfade is barely noticeable.
Line 192: Line 192:


----
----
==Exporting and importing tips==
==Exporting and importing tips==
To create a wav/aif file one needs to write a file header like below and then write the contents of the raw data part.
To create a wav/aif file one needs to write a file header like below and then write the contents of the raw data part.