renamed i2sOutputFlushScheduled

This commit is contained in:
Roman Lut 2025-05-26 14:07:57 +02:00
parent ad725ffc71
commit 50f033c617
3 changed files with 7 additions and 7 deletions

View file

@ -59,7 +59,7 @@ VolumeStream volume(i2s); //access from audioStreamTask only
QueueStream<uint8_t> queue(audioBuffer); //access from audioStreamTask only
StreamCopy copier(volume, queue);
AudioInfo info(SAMPLE_RATE, CHANNELS, BITS_PER_SAMPLE);
volatile bool outputFlushScheduled = false;
volatile bool i2sOutputFlushScheduled = false;
unsigned long getSpeakingDuration() {
if (deviceState == SPEAKING && speakingStartTime > 0) {
@ -91,7 +91,7 @@ void transitionToListening() {
Serial.println("Transitioning to listening mode");
i2sInputFlushScheduled = true;
outputFlushScheduled = true;
i2sOutputFlushScheduled = true;
Serial.println("Transitioned to listening mode");
@ -139,8 +139,8 @@ void audioStreamTask(void *parameter) {
volume.begin(vcfg);
while (1) {
if ( outputFlushScheduled) {
outputFlushScheduled = false;
if ( i2sOutputFlushScheduled) {
i2sOutputFlushScheduled = false;
i2s.flush();
volume.flush();
queue.flush();

View file

@ -31,7 +31,7 @@ extern VolumeStream volume;
extern QueueStream<uint8_t> queue;
extern StreamCopy copier;
extern AudioInfo info;
extern volatile bool outputFlushScheduled;
extern volatile bool i2sOutputFlushScheduled;
// AUDIO INPUT
extern I2SStream i2sInput;

View file

@ -31,7 +31,7 @@ void enterSleep()
// First, change device state to prevent any new data processing
deviceState = SLEEP;
scheduleListeningRestart = false;
outputFlushScheduled = true;
i2sOutputFlushScheduled = true;
i2sInputFlushScheduled = true;
vTaskDelay(10); //let all tasks accept state
@ -42,7 +42,7 @@ void enterSleep()
i2s_stop(I2S_PORT_OUT);
// Clear any remaining audio in buffer
outputFlushScheduled = true;
i2sOutputFlushScheduled = true;
// Properly disconnect WebSocket and wait for it to complete
if (webSocket.isConnected()) {