biner88 / metronome

Efficient, accurate, cross-platform metronome; supports volume, BPM, and audio source settings.
BSD 3-Clause "New" or "Revised" License
5 stars 5 forks source link

Error Android: setBMP(0) - com.sumsg.metronome.Metronome.calcSilence (Metronome.java:25) #8

Closed slawekkaw closed 5 months ago

slawekkaw commented 5 months ago

I delivered the version to the market and...Crashlitics reports errors:

Fatal Exception: java.lang.OutOfMemoryError Failed to allocate a 4294861232 byte allocation with 6291456 free bytes and 252MB until OOM, target footprint 10381008, growth limit 268435456 stack: com.sumsg.metronome.Metronome.calcSilence (Metronome.java:25) com.sumsg.metronome.Metronome.setBPM (Metronome.java:2) com.sumsg.metronome.MetronomePlugin.metronomeInit (MetronomePlugin.java:41)

The problem was because in the function metronomeInit() I used bpm:0

On the Android this produce this error. On Apple devices it is OK.

I propose solution for the future: The setBPM() function should be 0-tolerant

biner88 commented 5 months ago

The new version has restricted BPM to be greater than 0.