Shadowtrance bdb50505e7
Improvements and fixes (#655)
USB Audio Class (UAC) output
Audio codec re-binding
Keyboard / Bluetooth HID
HID Consumer Control (media keys)
Symbol exports
Other fixes
IMU-based screen auto-rotate

See PR for details: https://github.com/TactilityProject/Tactility/pull/655
2026-09-22 19:19:53 +02:00

62 lines
1.6 KiB
C++

// SPDX-License-Identifier: Apache-2.0
#include <audio_decoder/module.h>
#ifdef ESP_PLATFORM
#include <simple_dec/esp_audio_simple_dec.h>
#include <esp_audio_dec_default.h>
#include <esp_log.h>
// Registers Kconfig-selected decoders once so any app can use esp_audio_simple_dec_open()
// without registering itself.
static error_t audio_decoder_module_start(void) {
esp_audio_err_t dec_register_result = esp_audio_dec_register_default();
if (dec_register_result != ESP_AUDIO_ERR_OK) {
// Not a boot failure: apps can still use everything else. But without this, a later
// esp_audio_simple_dec_open() failure has no explanation in the log.
ESP_LOGE("audio-decoder", "esp_audio_dec_register_default failed: %d", (int) dec_register_result);
}
return ERROR_NONE;
}
extern "C" {
static const ModuleSymbol SYMBOLS[] = {
DEFINE_MODULE_SYMBOL(esp_audio_simple_check_audio_type),
DEFINE_MODULE_SYMBOL(esp_audio_simple_dec_open),
DEFINE_MODULE_SYMBOL(esp_audio_simple_dec_process),
DEFINE_MODULE_SYMBOL(esp_audio_simple_dec_get_info),
DEFINE_MODULE_SYMBOL(esp_audio_simple_dec_reset),
DEFINE_MODULE_SYMBOL(esp_audio_simple_dec_close),
MODULE_SYMBOL_TERMINATOR
};
Module audio_decoder_module = {
.name = "audio-decoder",
.start = audio_decoder_module_start,
.stop = nullptr,
.drivers = nullptr,
.symbols = SYMBOLS,
.internal = nullptr,
};
}
#else // !ESP_PLATFORM
extern "C" {
Module audio_decoder_module = {
.name = "audio-decoder",
.start = nullptr,
.stop = nullptr,
.drivers = nullptr,
.symbols = nullptr,
.internal = nullptr,
};
}
#endif // ESP_PLATFORM