Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions internal/MozziGuts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ uint64_t samples_written_to_buffer = 0;
inline void bufferAudioOutput(const AudioOutput f) {
audioOutput(f);
++samples_written_to_buffer;
#if MOZZI_IS(MOZZI__LEGACY_AUDIO_INPUT_IMPL, 1) // in that case, we rely on asynchroneous ADC reads implemented for mozziAnalogRead to get the audio in samples
MOZZI_ASSERT_NOTEQUAL(MOZZI_ANALOG_READ, MOZZI_ANALOG_READ_NONE);
adc_count = 0;
startSecondADCReadOnCurrentChannel();
#endif


}
#else
CircularBuffer<AudioOutput> output_buffer; // fixed size 256
Expand Down
2 changes: 1 addition & 1 deletion internal/config_checks_rp2040.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,6 @@ MOZZI_CHECK_SUPPORTED(MOZZI_I2S_FORMAT, MOZZI_I2S_FORMAT_PLAIN, MOZZI_I2S_FORMAT
#define MOZZI__INTERNAL_ANALOG_READ_RESOLUTION 12

MOZZI_CHECK_SUPPORTED(MOZZI_ANALOG_READ, MOZZI_ANALOG_READ_NONE, MOZZI_ANALOG_READ_STANDARD)
MOZZI_CHECK_SUPPORTED(MOZZI_AUDIO_INPUT, MOZZI_AUDIO_INPUT_NONE, MOZZI_ANALOG_READ_STANDARD)
MOZZI_CHECK_SUPPORTED(MOZZI_AUDIO_INPUT, MOZZI_AUDIO_INPUT_NONE, MOZZI_AUDIO_INPUT_STANDARD)

#endif // #ifndef CONFIG_CHECK_RP2040_H