Step 7.3: decode HLS TS segments to PCM (own TS demux + AAC decoder)
- main/decoder: MPEG-TS demux (packets reassembled across HTTP chunks, PAT -> PMT -> first ADTS-AAC PID, PES headers stripped) feeding the esp_audio_codec simple AAC decoder (ADTS, AAC-Plus enabled for HE-AAC v1/v2 variants). 7.3 only counts and logs PCM per segment. - esp_audio_codec pinned to ~2.5.0: 2.6+ needs P4 rev >= 3 (this board is rev 1.3). Noted in CLAUDE.md, also for esp_audio_effects < 1.4. - The library's combined TS decoder lost ~8% of the frames (segments decoded to 7.9-9.6 s, "decode error -1"); with the own demux every segment is sample exact: 441344 / 440320 frames = 10.008 / 9.985 s, matching EXTINF 10.0078 / 9.9846 (431 / 430 AAC frames), no errors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+6
-1
@@ -7,6 +7,7 @@
|
||||
#include "aes67_tx.h"
|
||||
#include "aes67_web.h"
|
||||
#include "audio_ring.h"
|
||||
#include "decoder.h"
|
||||
#include "hls.h"
|
||||
#include "esp_log.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
@@ -113,7 +114,11 @@ esp_err_t player_init(void)
|
||||
player_apply(src);
|
||||
cJSON_Delete(src);
|
||||
xTaskCreate(test_producer, "test_prod", 3072, NULL, 5, NULL);
|
||||
err = hls_start(NULL); // 7.2: fetch and log only; decoding in 7.3
|
||||
err = decoder_init();
|
||||
if (err != ESP_OK) {
|
||||
return err;
|
||||
}
|
||||
err = hls_start(decoder_feed); // 7.3: decode and log; resampling + ring in 7.4
|
||||
if (err != ESP_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user