Open lucarocchi opened 1 year ago
My guess would be that samples[j + 1] is out of range. It would be helpful to put
print("samples")
print(samples.count)
print(j+i)
print("resampled")
print(resampled.count)
print(i)
before that line to see if that is the crash. Can you make a simple example project to recreate the issue?
samples[min(j + 1, samples.count)]
might work if the index is too high, but I'm not really sure what that line is doing.
It's difficult to debug this without knowing the size of bufferSampleCount
, but everything else looks fine.
Try following the stack trace in the debugger. Xcode will show the error on every instruction leading up to where the error actually occurred.
If you can pin it down to happening on a line of code involving I also recommend writing an example to demonstrate the bug as Nick mentioned.NodeOutputView
,
Edit: Looking at this with a fresh set of eyes, now I can see how this involves FloatPlot
on line 115. Going to see if I can investigate further when I get another chance. Where are the samples coming from? I'm guessing some sort of Node
?
I have experienced this bug as well. I use NodeOutputView, and sometimes it would crash with an error similar to the above.
@emurray2, I saw you asking about buffer size...I noticed that for NodeOutputView, the default buffer is 1024. I had been using a buffer of 150. I'm still testing, but so far It seems that changing the buffer to 1024 has eliminated the crashes.
I don't think buffer size matters i have experienced it also with default buffer size or 2048
I don't think buffer size matters i have experienced it also with default buffer size or 2048
What I've noticed when I got this error is the node I was using was not stereo, and I was trying to access a buffer which was not there.
You may want to double check the node format or wherever the data inside FloatPlot
is coming from.
But definitely make an example project if you can with 1 node and the FloatPlot
demonstrating the bug. You could even try using different nodes and see if you get the same effect.
macOS Version(s) Used to Build
macOS 13 Ventura, macOS 12 Monterey
Xcode Version(s)
Xcode 14
Description
I'm working on an iOS app that uses NodeOutputView Randomly I get this "Index Out of range" as you can see in the screen shot
Crash Logs, Screenshots or Other Attachments (if applicable)