-
-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a9732f8
commit 2923c7f
Showing
2 changed files
with
42 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include "AudioTools.h" | ||
#include "AudioTools.h" | ||
|
||
AudioInfo info(44100, 1, 16); | ||
AnalogAudioStream adc; | ||
MeasuringStream out(10, &Serial); | ||
StreamCopy copier(out, adc); | ||
|
||
// Arduino Setup | ||
void setup(void) { | ||
Serial.begin(115200); | ||
AudioLogger::instance().begin(Serial, AudioLogger::Info); | ||
|
||
LOGI("Supported samples rates: %d - %d", SOC_ADC_SAMPLE_FREQ_THRES_LOW, SOC_ADC_SAMPLE_FREQ_THRES_HIGH) | ||
|
||
auto cfg = adc.defaultConfig(RX_MODE); | ||
cfg.copyFrom(info); | ||
//cfg.use_apll = false; // try with yes | ||
if (!adc.begin(cfg)) { | ||
LOGE("adc.begin() failed"); | ||
stop(); | ||
} | ||
|
||
// make sure that we have the correct channels set up | ||
out.begin(info); | ||
} | ||
|
||
// Arduino loop - copy data | ||
void loop() { | ||
copier.copy(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters