Constructor

PwgAudioBlocknew

since: 0.1

Declaration [src]

PwgAudioBlock*
pwg_audio_block_new (
  PwgAudioFormat* format,
  GBytes* data,
  unsigned int n_frames,
  uint64_t sequence,
  double peak
)

Description [src]

Creates an immutable audio block with owned sample data. The block never exposes PipeWire realtime buffer ownership to language bindings.

Stability: Unstable

Available since: 0.1

Parameters

format

Type: PwgAudioFormat

Audio format for this block.

The data is owned by the caller of the function.
data

Type: GBytes

Copied interleaved audio sample bytes.

The data is owned by the caller of the function.
n_frames

Type: unsigned int

Number of interleaved frames in data.

sequence

Type: uint64_t

Monotonic stream-local block sequence number.

peak

Type: double

Absolute sample peak in this block.

Return value

Type: PwgAudioBlock

A new audio block object.

The caller of the function takes ownership of the data, and is responsible for freeing it.