Fix Talkie output on ESP32 (#774)

Fixes #629

Need to set the I2S clock after begin() for ESP32
This commit is contained in:
Earle F. Philhower, III authored and GitHub committed 2025-10-08 17:01:58 -07:00
1 parent 15f9a65afa
commit 81ebc8a11a
1 file changed
+15 -14
+15 -14
View File
@@ -72,6 +72,21 @@ bool AudioGeneratorTalkie::begin(AudioFileSource *source, AudioOutput *output) {
return false;
}
this->output = output;
if (!output->SetBitsPerSample(16)) {
return false;
}
if (!output->SetChannels(2)) {
return false;
}
if (!output->begin()) {
return false;
}
if (!output->SetRate(8000)) {
return false;
}
if (source) {
file = source;
if (!file->isOpen()) {
@@ -95,20 +110,6 @@ bool AudioGeneratorTalkie::begin(AudioFileSource *source, AudioOutput *output) {
running = false;
}
if (!output->SetRate(8000)) {
return false;
}
if (!output->SetBitsPerSample(16)) {
return false;
}
if (!output->SetChannels(2)) {
return false;
}
if (!output->begin()) {
return false;
}
return true;
}