Function spdl::core::create_reference_audio_frame

Function Documentation

AudioFramesPtr spdl::core::create_reference_audio_frame(const std::string &sample_fmt, const void *data, int bits, const std::array<size_t, 2> &shape, const std::array<int64_t, 2> &stride, int sample_rate, int64_t pts)

Create an audio frame referencing external data.

Creates a frame that references externally managed memory without copying. The caller must ensure the data remains valid for the lifetime of the frame.

Parameters:
  • sample_fmt – Sample format string (e.g., “s16”, “f32”).

  • data – Pointer to external audio data.

  • bits – Bits per sample.

  • shape – Shape array [num_channels, num_samples].

  • stride – Stride array [channel_stride, sample_stride].

  • sample_rate – Sample rate in Hz.

  • pts – Presentation timestamp.

Returns:

Audio frames referencing the external data.