diff --git a/src/AudioCodecs/DecoderFromStreaming.h b/src/AudioCodecs/DecoderFromStreaming.h index b0b4f26eb8..922ffe60d3 100644 --- a/src/AudioCodecs/DecoderFromStreaming.h +++ b/src/AudioCodecs/DecoderFromStreaming.h @@ -15,11 +15,7 @@ namespace audio_tools { */ class DecoderFromStreaming : public AudioDecoder { public: - /** - * @brief Constructor for a new DecoderBase64 object - * - * @param out_buffeream Output Stream to which we write the decoded result - */ + /// Default Constructor DecoderFromStreaming(StreamingDecoder &dec, int bufferSize) { TRACED(); p_dec = &dec; diff --git a/src/AudioConfig.h b/src/AudioConfig.h index f86050847f..7648449794 100644 --- a/src/AudioConfig.h +++ b/src/AudioConfig.h @@ -317,8 +317,8 @@ extern "C" void app_main(); // delay and millis is needed by this framework namespace audio_tools { -void delay(uint64_t ms){ vTaskDelay(1000 / portTICK_PERIOD_MS);} -uint64_t millis() {return (xTaskGetTickCount() * portTICK_PERIOD_MS);} +void delay(uint32_t ms){ vTaskDelay(1000 / portTICK_PERIOD_MS);} +uint32_t millis() {return (xTaskGetTickCount() * portTICK_PERIOD_MS);} } #endif diff --git a/src/AudioLibs/Desktop/Millis.h b/src/AudioLibs/Desktop/Millis.h index 8fe178a7e4..66feab3dce 100644 --- a/src/AudioLibs/Desktop/Millis.h +++ b/src/AudioLibs/Desktop/Millis.h @@ -7,14 +7,14 @@ namespace audio_tools { /// Waits for the indicated milliseconds -void delay(uint64_t ms) { +void delay(uint32_t ms) { //std::this_thread::sleep_for(std::chrono::milliseconds(ms)); auto end = millis()+ms; while(millis()<=end); } /// Returns the milliseconds since the start -uint64_t millis(){ +uint32_t millis(){ using namespace std::chrono; // Get current time with precision of milliseconds auto now = time_point_cast(system_clock::now()); diff --git a/src/AudioLibs/RTSP.h b/src/AudioLibs/RTSP.h index 9d873000e7..1304b0518a 100644 --- a/src/AudioLibs/RTSP.h +++ b/src/AudioLibs/RTSP.h @@ -156,7 +156,7 @@ class RTSPSourceFromAudioStream : public IAudioSource { protected: AudioStream *p_audiostream = nullptr; - uint64_t time_of_last_read = 0; + uint32_t time_of_last_read = 0; bool started = true; RTSPOutputPCMInfo pcmInfo; RTSPFormatPCM format{pcmInfo}; diff --git a/src/AudioTools/AudioIO.h b/src/AudioTools/AudioIO.h index 6db0a8e05e..142628a37f 100644 --- a/src/AudioTools/AudioIO.h +++ b/src/AudioTools/AudioIO.h @@ -336,7 +336,7 @@ class RateMeasuringStream : public AudioStream { void setReportAt(int at) { count_at = at; } /// Defines an alternative method to determine millis() - void setTimeCallback(uint64_t (*cb_ms)(void)) { millis_cb = cb_ms; } + void setTimeCallback(uint32_t (*cb_ms)(void)) { millis_cb = cb_ms; } int availableForWrite() override { if (p_out == nullptr) @@ -419,12 +419,12 @@ class RateMeasuringStream : public AudioStream { Print *p_out = nullptr; uint32_t counter = 0; uint32_t count_at = -1; - uint64_t start_time = 0; - uint64_t last_time = 0; - uint64_t total_bytes = 0; - uint64_t (*millis_cb)(void) = nullptr; + uint32_t start_time = 0; + uint32_t last_time = 0; + uint32_t total_bytes = 0; + uint32_t (*millis_cb)(void) = nullptr; - inline uint64_t ms() { + inline uint32_t ms() { if (millis_cb) return millis_cb(); return millis(); diff --git a/src/AudioTools/AudioOutput.h b/src/AudioTools/AudioOutput.h index f7522504d9..3e03927413 100644 --- a/src/AudioTools/AudioOutput.h +++ b/src/AudioTools/AudioOutput.h @@ -811,10 +811,10 @@ class Throttle : public AudioOutput { } protected: - uint64_t start_time; - uint64_t sum_samples = 0; + uint32_t start_time = 0; + uint32_t sum_samples = 0; ThrottleConfig info; - int bytesPerSample; + int bytesPerSample = 0; Print *p_out = nullptr; }; diff --git a/src/AudioTools/AudioPlayer.h b/src/AudioTools/AudioPlayer.h index 13fe2cb0f8..45439aa090 100644 --- a/src/AudioTools/AudioPlayer.h +++ b/src/AudioTools/AudioPlayer.h @@ -480,7 +480,7 @@ namespace audio_tools { StreamCopy copier; // copies sound into i2s AudioInfo info; bool meta_active = false; - uint64_t timeout = 0; + uint32_t timeout = 0; int stream_increment = 1; // +1 moves forward; -1 moves backward float current_volume = -1.0; // illegal value which will trigger an update int delay_if_full = 100; diff --git a/src/AudioTools/AudioStreams.h b/src/AudioTools/AudioStreams.h index 38d3a6c3db..9f37650e61 100644 --- a/src/AudioTools/AudioStreams.h +++ b/src/AudioTools/AudioStreams.h @@ -1058,7 +1058,7 @@ class MeasuringStream : public AudioStream { } /// Provides the time when the last measurement was started - uint64_t startTime() { + uint32_t startTime() { return start_time; } @@ -1071,7 +1071,7 @@ class MeasuringStream : public AudioStream { int count=0; Stream *p_stream=nullptr; Print *p_print=nullptr; - uint64_t start_time; + uint32_t start_time; int total_bytes = 0; int bytes_per_second = 0; int sample_div = 0; @@ -1083,7 +1083,7 @@ class MeasuringStream : public AudioStream { total_bytes+=len; if (count<0){ - uint64_t end_time = millis(); + uint32_t end_time = millis(); int time_diff = end_time - start_time; // in ms if (time_diff>0){ bytes_per_second = total_bytes / time_diff * 1000;