|
TB2026-YDS Firmware
|
Decoder facade: owns the FILE*, auto-detects the format, delegates to a backend. More...
#include "decoder.h"#include "decoder_backend.h"#include "esp_log.h"#include <stdio.h>#include <string.h>#include <strings.h>Functions | |
| esp_err_t | decoder_open (const char *path) |
| Open an audio file, pick the backend, and read its format. | |
| esp_err_t | decoder_format (decoder_format_t *fmt) |
| Get the PCM format of the open stream. | |
| esp_err_t | decoder_read (void *pcm, size_t cap_bytes, size_t *got_bytes) |
Decode the next chunk of audio into pcm. | |
| esp_err_t | decoder_close (void) |
| Close the stream and free the decoder. Safe to call when nothing is open. | |
Decoder facade: owns the FILE*, auto-detects the format, delegates to a backend.
Detection is by extension (.mp3 / .wav), confirmed against the file's magic bytes; if the two disagree the magic wins. Callers see only the concrete decoder.h API and never learn which backend is active.