Core types for audio nodes, formats, buffers, and built-in processor node factories.
More...
|
|
#define | OVE_AUDIO_MAX_CHANNELS 8 |
| | Maximum number of audio channels supported by the channel-map node.
|
| |
|
| static unsigned int | ove_audio_sample_size (enum ove_audio_sample_fmt fmt) |
| | Return the size in bytes of one sample for a given format.
|
| |
| static int | ove_audio_fmt_equal (const struct ove_audio_fmt *a, const struct ove_audio_fmt *b) |
| | Test two format descriptors for equality.
|
| |
| int | ove_audio_node_converter (struct ove_audio_graph *g, enum ove_audio_sample_fmt target_fmt, const char *name) |
| | Add a sample-format converter processor node to the graph.
|
| |
| int | ove_audio_node_channel_map (struct ove_audio_graph *g, const struct ove_audio_channel_map *map, const char *name) |
| | Add a channel-mapping processor node to the graph.
|
| |
| int | ove_audio_node_gain (struct ove_audio_graph *g, float gain_db, const char *name) |
| | Add a gain processor node to the graph.
|
| |
| int | ove_audio_node_tap (struct ove_audio_graph *g, ove_audio_tap_fn fn, void *user_data, const char *name) |
| | Add a tap (observer) sink node to the graph.
|
| |
Core types for audio nodes, formats, buffers, and built-in processor node factories.
Defines the fundamental data types shared by every node in the audio graph: sample format, format descriptor, audio buffer, node vtable, and node descriptor. Also provides a small set of ready-made processor node factories (format converter, channel mapper, gain, and tap observer).
- Note
- Requires
CONFIG_OVE_AUDIO.
◆ ove_audio_tap_fn
| typedef void(* ove_audio_tap_fn) (const struct ove_audio_buf *buf, void *user_data) |
Callback invoked by the tap node for every processed buffer.
- Parameters
-
| [in] | buf | Buffer containing the observed audio data. |
| [in] | user_data | Opaque pointer supplied at node creation. |
◆ ove_audio_sample_fmt
PCM sample format tag.
Identifies the numeric type and bit-depth of each audio sample.
| Enumerator |
|---|
| OVE_AUDIO_FMT_S16 | Signed 16-bit integer (int16_t).
|
| OVE_AUDIO_FMT_S32 | Signed 32-bit integer (int32_t).
|
| OVE_AUDIO_FMT_F32 | 32-bit IEEE 754 float.
|
◆ ove_audio_node_type
Role of a node within the audio graph.
| Enumerator |
|---|
| OVE_AUDIO_NODE_SOURCE | Produces audio; has no upstream connection.
|
| OVE_AUDIO_NODE_PROCESSOR | Transforms audio; has one upstream connection.
|
| OVE_AUDIO_NODE_SINK | Consumes audio; has no downstream connection.
|
◆ ove_audio_sample_size()
Return the size in bytes of one sample for a given format.
- Parameters
-
| [in] | fmt | Sample format tag. |
- Returns
- Byte size of one sample, or 0 for an unrecognised format.
◆ ove_audio_fmt_equal()
Test two format descriptors for equality.
- Parameters
-
| [in] | a | First format descriptor. |
| [in] | b | Second format descriptor. |
- Returns
- Non-zero if all fields match, zero otherwise.
◆ ove_audio_node_converter()
Add a sample-format converter processor node to the graph.
Inserts a processor that converts any upstream sample format to target_fmt while preserving sample rate and channel count.
- Parameters
-
| [in] | g | Graph to add the node to. |
| [in] | target_fmt | Desired output sample format. |
| [in] | name | Human-readable name for the node. |
- Returns
- Non-negative node index on success, negative error code on failure.
- Note
- Requires
CONFIG_OVE_AUDIO.
- See also
- ove_audio_graph_add_node, ove_audio_graph_connect
◆ ove_audio_node_channel_map()
Add a channel-mapping processor node to the graph.
Inserts a processor that reorders, duplicates, or silences channels according to map. The output channel count equals map->out_channels.
- Parameters
-
| [in] | g | Graph to add the node to. |
| [in] | map | Channel routing descriptor. |
| [in] | name | Human-readable name for the node. |
- Returns
- Non-negative node index on success, negative error code on failure.
- Note
- Requires
CONFIG_OVE_AUDIO.
- See also
- ove_audio_node_converter
◆ ove_audio_node_gain()
| int ove_audio_node_gain |
( |
struct ove_audio_graph * |
g, |
|
|
float |
gain_db, |
|
|
const char * |
name |
|
) |
| |
Add a gain processor node to the graph.
Inserts a processor that applies a fixed gain of gain_db decibels to every sample. Positive values amplify; negative values attenuate. The output format is identical to the input format.
- Parameters
-
| [in] | g | Graph to add the node to. |
| [in] | gain_db | Gain in decibels (e.g. -6.0f for -6 dB). |
| [in] | name | Human-readable name for the node. |
- Returns
- Non-negative node index on success, negative error code on failure.
- Note
- Requires
CONFIG_OVE_AUDIO.
◆ ove_audio_node_tap()
Add a tap (observer) sink node to the graph.
Inserts a sink that calls fn for every audio buffer processed. The callback receives a pointer to the upstream buffer; data must not be stored beyond the duration of the callback.
- Parameters
-
| [in] | g | Graph to add the node to. |
| [in] | fn | Callback invoked each processing cycle. |
| [in] | user_data | Opaque pointer forwarded to fn. |
| [in] | name | Human-readable name for the node. |
- Returns
- Non-negative node index on success, negative error code on failure.
- Note
- Requires
CONFIG_OVE_AUDIO.
- See also
- ove_audio_node_gain