diff options
Diffstat (limited to 'src/Ryujinx.Audio/Renderer/Dsp/DataSourceHelper.cs')
-rw-r--r-- | src/Ryujinx.Audio/Renderer/Dsp/DataSourceHelper.cs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Ryujinx.Audio/Renderer/Dsp/DataSourceHelper.cs b/src/Ryujinx.Audio/Renderer/Dsp/DataSourceHelper.cs index 12e0f13f..98657bd1 100644 --- a/src/Ryujinx.Audio/Renderer/Dsp/DataSourceHelper.cs +++ b/src/Ryujinx.Audio/Renderer/Dsp/DataSourceHelper.cs @@ -76,7 +76,7 @@ namespace Ryujinx.Audio.Renderer.Dsp if (!info.DecodingBehaviour.HasFlag(DecodingBehaviour.SkipPitchAndSampleRateConversion)) { - voiceState.Pitch.AsSpan().Slice(0, pitchMaxLength).CopyTo(tempBuffer); + voiceState.Pitch.AsSpan()[..pitchMaxLength].CopyTo(tempBuffer); tempBufferIndex += pitchMaxLength; } @@ -107,7 +107,7 @@ namespace Ryujinx.Audio.Renderer.Dsp voiceState.LoopContext = memoryManager.Read<AdpcmLoopContext>(waveBuffer.Context); } - Span<short> tempSpan = tempBuffer.Slice(tempBufferIndex + y); + Span<short> tempSpan = tempBuffer[(tempBufferIndex + y)..]; int decodedSampleCount = -1; @@ -168,7 +168,7 @@ namespace Ryujinx.Audio.Renderer.Dsp decodedSampleCount = PcmHelper.Decode(tempSpan, waveBufferPcmFloat, targetSampleStartOffset, targetSampleEndOffset, info.ChannelIndex, info.ChannelCount); break; default: - Logger.Error?.Print(LogClass.AudioRenderer, $"Unsupported sample format " + info.SampleFormat); + Logger.Error?.Print(LogClass.AudioRenderer, "Unsupported sample format " + info.SampleFormat); break; } @@ -220,7 +220,7 @@ namespace Ryujinx.Audio.Renderer.Dsp } } - Span<int> outputSpanInt = MemoryMarshal.Cast<float, int>(outputBuffer.Slice(i)); + Span<int> outputSpanInt = MemoryMarshal.Cast<float, int>(outputBuffer[i..]); if (info.DecodingBehaviour.HasFlag(DecodingBehaviour.SkipPitchAndSampleRateConversion)) { @@ -231,9 +231,9 @@ namespace Ryujinx.Audio.Renderer.Dsp } else { - Span<short> tempSpan = tempBuffer.Slice(tempBufferIndex + y); + Span<short> tempSpan = tempBuffer[(tempBufferIndex + y)..]; - tempSpan.Slice(0, sampleCountToDecode - y).Fill(0); + tempSpan[..(sampleCountToDecode - y)].Clear(); ToFloat(outputBuffer, outputSpanInt, sampleCountToProcess); |