Dispose some sound streams.

This commit is contained in:
RoosterDragon
2016-12-23 19:37:17 +00:00
parent 53bd29351b
commit 226c0a050a
6 changed files with 32 additions and 16 deletions

View File

@@ -48,13 +48,14 @@ namespace OpenRA.Mods.Common.AudioLoaders
}
}
public class WavFormat : ISoundFormat
public sealed class WavFormat : ISoundFormat
{
public int Channels { get { return reader.Value.Channels; } }
public int SampleBits { get { return reader.Value.BitsPerSample; } }
public int SampleRate { get { return reader.Value.SampleRate; } }
public float LengthInSeconds { get { return WavReader.WaveLength(stream); } }
public Stream GetPCMInputStream() { return new MemoryStream(reader.Value.RawOutput); }
public void Dispose() { stream.Dispose(); }
Lazy<WavReader> reader;