Skip to content

Commit

Permalink
Fill buffer with default samples if not active
Browse files Browse the repository at this point in the history
  • Loading branch information
Nytra committed Dec 27, 2024
1 parent 42a1d8f commit 970b5ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions ProjectObsidian/Components/Audio/BandPassFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public void Read<S>(Span<S> buffer) where S : unmanaged, IAudioSample<S>
{
if (!IsActive)
{
buffer.Fill(default(S));
return;
}

Expand Down
2 changes: 2 additions & 0 deletions ProjectObsidian/Components/Audio/FrequencyModulator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ public void Read<S>(Span<S> buffer) where S : unmanaged, IAudioSample<S>
{
if (!IsActive)
{
buffer.Fill(default(S));
return;
}

int channelCount = ChannelCount;
if (channelCount == 0)
{
buffer.Fill(default(S));
return;
}

Expand Down

0 comments on commit 970b5ee

Please sign in to comment.