diff --git a/MicroMDAEPiano.ino b/MicroMDAEPiano.ino index d224406..15f12aa 100644 --- a/MicroMDAEPiano.ino +++ b/MicroMDAEPiano.ino @@ -264,7 +264,6 @@ void loop() { int16_t* audio_buffer_r; // pointer to AUDIO_BLOCK_SAMPLES * sizeof(int16_t) int16_t* audio_buffer_l; // pointer to AUDIO_BLOCK_SAMPLES * sizeof(int16_t) - const uint16_t audio_block_time_ms = 1000000 / (SAMPLE_RATE / AUDIO_BLOCK_SAMPLES); // Main sound calculation if (queue_r.available() && queue_l.available() && fill_audio_buffer > audio_block_time_us - 10) @@ -293,7 +292,7 @@ void loop() elapsedMicros t1; ep->process(audio_buffer_l, audio_buffer_r); uint32_t t2 = t1; - if (t2 > audio_block_time_ms) // everything greater 2.9ms is a buffer underrun! + if (t2 > audio_block_time_us) // everything greater 2.9ms is a buffer underrun! xrun++; if (t2 > render_time_max) render_time_max = t2;