Unstable 1.2.4.0
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
using System;
|
||||
using NVorbis;
|
||||
using OpenAL;
|
||||
using NVorbis;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Barotrauma.Sounds
|
||||
{
|
||||
sealed class OggSound : Sound
|
||||
{
|
||||
private VorbisReader streamReader;
|
||||
private readonly VorbisReader streamReader;
|
||||
|
||||
public long MaxStreamSamplePos => streamReader == null ? 0 : streamReader.TotalSamples * streamReader.Channels * 2;
|
||||
|
||||
private List<float> playbackAmplitude;
|
||||
private const int AMPLITUDE_SAMPLE_COUNT = 4410; //100ms in a 44100hz file
|
||||
@@ -101,7 +102,7 @@ namespace Barotrauma.Sounds
|
||||
if (!Stream) { throw new Exception("Called FillStreamBuffer on a non-streamed sound!"); }
|
||||
if (streamReader == null) { throw new Exception("Called FillStreamBuffer when the reader is null!"); }
|
||||
|
||||
if (samplePos >= streamReader.TotalSamples * streamReader.Channels * 2) return 0;
|
||||
if (samplePos >= MaxStreamSamplePos) { return 0; }
|
||||
|
||||
samplePos /= streamReader.Channels * 2;
|
||||
streamReader.DecodedPosition = samplePos;
|
||||
|
||||
Reference in New Issue
Block a user