AudioKit / AudioKitUI

Controls and Visualization for AudioKit apps
MIT License
187 stars 52 forks source link

AudioFileWaveform Crash with small audio files #52

Closed ShowtimeSoft closed 2 years ago

ShowtimeSoft commented 2 years ago

Thanks for the newly added AudioFileWaveform View.

I get a crash if I add very small audio files: Fatal error: Range requires lowerBound <= upperBound

My very small audio file has only a few samples, which is probably less than the default rmsWindowSize of 256. So the crash happens in AudioHelpers.createRMSAnalysisArray, Line 86, because numberOfOutputArrays gets negative.

Here is the audio file: 44100 _verySmall.aif.zip

Also, I can't seem to access the functions in AudioHelpers from my own code - that might be because they are not marked public? That is also true for the AudioWaveform struct.

Thanks!

Matt54 commented 2 years ago

Closing this issue due to #53