MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
SoundFileContainer.hpp
Go to the documentation of this file.
1#pragma once
2
6
7namespace MayaFlux::Kakshya {
8
9/**
10 * @class SoundFileContainer
11 * @brief File-backed audio container with complete streaming functionality
12 *
13 * SoundFileContainer combines file-specific semantics (FileContainer) with
14 * full streaming capabilities (SoundStreamContainer). It provides:
15 * - Complete streaming functionality inherited from SoundStreamContainer
16 * - File-specific metadata and semantic marking from FileContainer
17 * - Specialized file loading and capacity management
18 *
19 * The container extends SoundStreamContainer's streaming capabilities with
20 * file-specific concerns like fixed capacity and file metadata handling.
21 *
22 * Dimensions:
23 * - [0] Time (samples/frames)
24 * - [1] Channels
25 * - [N] Additional dimensions for spectral data, analysis results, etc.
26 */
27class MAYAFLUX_API SoundFileContainer : public FileContainer, public SoundStreamContainer {
28public:
29 /**
30 * @brief Construct a SoundFileContainer with default parameters
31 * Uses reasonable defaults suitable for file containers
32 */
34
35 /**
36 * @brief Construct a SoundFileContainer with specific parameters
37 * @param sample_rate Sample rate for the audio file
38 * @param num_channels Number of audio channels
39 * @param initial_capacity Initial capacity in frames
40 */
41 SoundFileContainer(uint32_t sample_rate, uint32_t num_channels, uint64_t initial_capacity = 0);
42
44
45 // ===== File-Specific Methods =====
46
47 /**
48 * @brief Setup the container with file parameters
49 * @param num_frames Total number of frames in the file
50 * @param sample_rate Sample rate of the audio
51 * @param num_channels Number of audio channels
52 */
53 void setup(uint64_t num_frames, uint32_t sample_rate, uint32_t num_channels);
54
55 /**
56 * @brief Set raw data from external source (e.g., file loading)
57 * @param data The audio data as DataVariant
58 */
59 void set_raw_data(const std::vector<DataVariant>& data);
60
61 /**
62 * @brief Enable debug output for this container
63 * @param enable Whether to enable debug output
64 */
65
66 double get_duration_seconds() const;
67};
68
69} // namespace MayaFlux::Kakshya
Marker interface for containers backed by file storage (in-memory only).
File-backed audio container with complete streaming functionality.
Concrete base implementation for streaming audio containers.