Skip to content
This repository has been archived by the owner on Dec 24, 2020. It is now read-only.

Commit

Permalink
Fix audio preview for multi channel sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
mafiesto4 committed Dec 18, 2018
1 parent b8f40ef commit 7d9cc71
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions FlaxEditor/Viewport/Previews/AudioClipPreview.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,8 @@ public override void Draw()
float sampleYScale = Height / info.NumChannels;

// Sample count
uint totalSampleCount = info.NumSamples;
uint numSamplesPerChannel = info.NumSamples / info.NumChannels;
uint samplesPerIndex = (uint)(totalSampleCount / Width);
uint samplesPerIndex = (uint)(numSamplesPerChannel / Width);

// Render each channel separately so outer loop is the sound wave channel index
for (uint channelIndex = 0; channelIndex < info.NumChannels; channelIndex++)
Expand Down

0 comments on commit 7d9cc71

Please sign in to comment.