Wav music packs now work correctly. WOOT!

This commit is contained in:
2018-03-21 02:04:05 -07:00
parent def22386c5
commit fd53797c5f
1 changed files with 13 additions and 1 deletions

View File

@ -111,6 +111,7 @@ namespace StardewSymphonyRemastered.Framework
byteArray = reader.ReadBytes(dataSize);
dynamicSound = new DynamicSoundEffectInstance(sampleRate, (AudioChannels)channels);
count = dynamicSound.GetSampleSizeInBytes(TimeSpan.FromMilliseconds(10000));
@ -119,8 +120,19 @@ namespace StardewSymphonyRemastered.Framework
}
void DynamicSound_BufferNeeded(object sender, EventArgs e)
{
//StardewSymphony.ModMonitor.Log(byteArray.Length.ToString());
//StardewSymphony.ModMonitor.Log(position.ToString());
//StardewSymphony.ModMonitor.Log(count.ToString());
try
{
dynamicSound.SubmitBuffer(byteArray, position, count);
}
catch(Exception err)
{
StardewSymphony.ModMonitor.Log(err.ToString(), StardewModdingAPI.LogLevel.Error);
}
//dynamicSound.SubmitBuffer(byteArray);
//dynamicSound.SubmitBuffer(byteArray, position + count / 2, count / 2);