Your ROOT_URL in app.ini is https://git.ondrovo.com/ but you are visiting http://159.69.29.240:49153/MightyPork/tangara-fw/blame/commit/a4f94c812a4da7254d31af4061a8f234a1e0e23d/src/audio/stream_buffer.cpp You should set ROOT_URL correctly, otherwise the web may not work correctly.
Fork of Tangara with customizations
tangara-fw/src/audio/stream_buffer.cpp

40 lines
1.2 KiB

/*
* Copyright 2023 jacqueline <me@jacqueline.id.au>
*
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "stream_buffer.hpp"
#include "assert.h"
#include "esp_log.h"
namespace audio {
StreamBuffer::StreamBuffer(std::size_t chunk_size, std::size_t buffer_size)
: raw_memory_(static_cast<std::byte*>(
heap_caps_malloc(buffer_size, MALLOC_CAP_SPIRAM))),
handle_(
xMessageBufferCreateStatic(buffer_size,
reinterpret_cast<uint8_t*>(raw_memory_),
&metadata_)),
raw_input_chunk_(static_cast<std::byte*>(
heap_caps_malloc(chunk_size * 1.5, MALLOC_CAP_SPIRAM))),
input_chunk_(raw_input_chunk_, chunk_size * 1.5),
raw_output_chunk_(static_cast<std::byte*>(
heap_caps_malloc(chunk_size, MALLOC_CAP_SPIRAM))),
output_chunk_(raw_output_chunk_, chunk_size) {
assert(input_chunk_.size() <= buffer_size);
assert(output_chunk_.size() <= buffer_size);
ESP_LOGI("streambuf", "created buffer of chunk size %d, total size %d",
chunk_size, buffer_size);
}
StreamBuffer::~StreamBuffer() {
vMessageBufferDelete(handle_);
free(raw_memory_);
free(raw_input_chunk_);
free(raw_output_chunk_);
}
} // namespace audio