The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
audio_ops_t Struct Reference

#include </home/runner/work/ginnOS-docs/ginnOS-docs/ginnOS/src/kernel/audio/audio.h>

Data Fields

bool(*) start (audio_device_t *dev)
 start playing.
void(*) stop (audio_device_t *dev)
 stop playing.
uint32_t(*) set_rate (audio_device_t *dev, uint32_t rate)
 use a sample rate, or the nearest one the device has.
void(*) set_volume (audio_device_t *dev, uint32_t left, uint32_t right)
 set the output volume (optional).

Field Documentation

◆ start

bool(*) audio_ops_t::start(audio_device_t *dev)

start playing.

the driver fills all its periods with audio_pull first. called in process context.

Returns
false if the device cannot start.

◆ stop

void(*) audio_ops_t::stop(audio_device_t *dev)

stop playing.

called in process context.

◆ set_rate

uint32_t(*) audio_ops_t::set_rate(audio_device_t *dev, uint32_t rate)

use a sample rate, or the nearest one the device has.

called only while the device is stopped.

Parameters
ratethe wanted rate in Hz.
Returns
the rate in use.

◆ set_volume

void(*) audio_ops_t::set_volume(audio_device_t *dev, uint32_t left, uint32_t right)

set the output volume (optional).

Parameters
leftthe left volume, 0 to 100.
rightthe right volume, 0 to 100.

The documentation for this struct was generated from the following file: