Skip to content

Commit

Permalink
fix some ealayer3 sounds (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmicDreamsOfCode committed Jan 11, 2023
1 parent 5a6ee65 commit 105dc27
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Plugins/SoundEditorPlugin/FrostySoundWaveEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,12 @@ protected override List<SoundDataTrack> InitialLoad(FrostyTaskWindow task)
}

reader.Position = segment.SamplesOffset;
byte[] soundBuf = reader.ReadToEnd();
long size = reader.Length - reader.Position;
if ((runtimeVariation.FirstSegmentIndex + i + 1 < soundWave.Segments.Count) && ((soundWave.Segments[runtimeVariation.FirstSegmentIndex + i + 1].SamplesOffset > segment.SamplesOffset)))
{
size = soundWave.Segments[runtimeVariation.FirstSegmentIndex + i + 1].SamplesOffset - reader.Position;
}
byte[] soundBuf = reader.ReadBytes((int)size);
double duration = 0.0;

if (codec == 0x12)
Expand Down

0 comments on commit 105dc27

Please sign in to comment.