ChapterForge
Loading...
Searching...
No Matches
aac_extractor.hpp
Go to the documentation of this file.
1//
2// aac_extractor.hpp
3// ChapterForge
4//
5// Created by Till Toenshoff on 12/9/25.
6// Copyright © 2025 Till Toenshoff. All rights reserved.
7//
8
9#pragma once
10#include <cstdint>
11#include <optional>
12#include <string>
13#include <vector>
14
16 std::vector<std::vector<uint8_t>> frames; // raw AAC frames (ADTS header stripped)
17 std::vector<uint32_t> sizes; // raw frame sizes
18
19 uint32_t sample_rate = 0;
20 uint8_t sampling_index = 0;
21 uint8_t channel_config = 0;
22 uint8_t audio_object_type = 0; // e.g. 2 = AAC LC
23
24 // Optional: original stsd payload (for mp4 inputs) so we can reuse esds.
25 std::vector<uint8_t> stsd_payload;
26 std::vector<uint8_t> stts_payload;
27 std::vector<uint8_t> stsc_payload;
28 std::vector<uint8_t> stsz_payload;
29 std::vector<uint8_t> stco_payload;
30
31 // Optional: original meta/ilst payloads (when source is MP4/M4A)
32 std::vector<uint8_t> meta_payload;
33 std::vector<uint8_t> ilst_payload;
34};
35
39AacExtractResult extract_adts_frames(const std::vector<uint8_t> &data);
40
47std::optional<AacExtractResult> extract_from_mp4(const std::string &path);
std::vector< uint8_t > meta_payload
Definition aac_extractor.hpp:32
std::vector< uint8_t > stts_payload
Definition aac_extractor.hpp:26
std::optional< AacExtractResult > extract_from_mp4(const std::string &path)
Extract AAC frames and related tables from an MP4/M4A source.
std::vector< uint8_t > ilst_payload
Definition aac_extractor.hpp:33
std::vector< uint8_t > stco_payload
Definition aac_extractor.hpp:29
std::vector< uint8_t > stsz_payload
Definition aac_extractor.hpp:28
std::vector< uint8_t > stsd_payload
Definition aac_extractor.hpp:25
uint32_t sample_rate
Definition aac_extractor.hpp:19
uint8_t channel_config
Definition aac_extractor.hpp:21
std::vector< std::vector< uint8_t > > frames
Definition aac_extractor.hpp:16
uint8_t sampling_index
Definition aac_extractor.hpp:20
AacExtractResult extract_adts_frames(const std::vector< uint8_t > &data)
Extract AAC frames from a raw ADTS buffer.
std::vector< uint32_t > sizes
Definition aac_extractor.hpp:17
uint8_t audio_object_type
Definition aac_extractor.hpp:22
std::vector< uint8_t > stsc_payload
Definition aac_extractor.hpp:27
Definition aac_extractor.hpp:15