Ignore:
Timestamp:
May 8, 2021, 3:44:24 AM (4 years ago)
Author:
geyser
Message:

Fixed importing of "fact" chunk, as well as an unhandled fatal when attempting to transcode IMA4 to MS ADPCM. Also added missing padding to SNDD template and fixed the duration calculation for WAV-to-SNDD.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OniSplit/Sound/WavImporter.cs

    r1154 r1156  
    4646        private void WriteSNDD(string name, WavFile wav)
    4747        {
    48             float duration = wav.SoundData.Length * 8.0f / wav.BitsPerSample;
    49             duration /= wav.SampleRate;
    50             duration /= wav.ChannelCount;
    51             duration *= 60.0f;
     48            float duration = wav.SampleCount * 60.0f / wav.SampleRate;
    5249
    5350            var sndd = CreateInstance(TemplateTag.SNDD, name);
     
    7471                    writer.Write(wav.SoundData.Length);
    7572                    writer.Write(WriteRawPart(wav.SoundData));
     73                    writer.Skip(8);
    7674                }
    7775            }
     
    9795                    writer.Write(wav.SoundData.Length);
    9896                    writer.Write(WriteRawPart(wav.SoundData));
     97                    writer.Skip(24);
    9998                }
    10099            }
Note: See TracChangeset for help on using the changeset viewer.