libsoundio  1.1.0
SoundIo Struct Reference

The size of this struct is not part of the API or ABI. More...

Data Fields

void * userdata
 Optional. Put whatever you want here. Defaults to NULL. More...
void(* on_devices_change )(struct SoundIo *)
 Optional callback. More...
void(* on_backend_disconnect )(struct SoundIo *, int err)
 Optional callback. More...
void(* on_events_signal )(struct SoundIo *)
 Optional callback. More...
enum SoundIoBackend current_backend
 Read-only. More...
const char * app_name
 Optional: Application name. More...
void(* emit_rtprio_warning )(void)
 Optional: Real time priority warning. More...
void(* jack_info_callback )(const char *msg)
 Optional: JACK info callback. More...
void(* jack_error_callback )(const char *msg)
 Optional: JACK error callback. More...

Detailed Description

The size of this struct is not part of the API or ABI.

backend_disconnect_recover.c, sio_list_devices.c, sio_microphone.c, sio_record.c, and sio_sine.c.

Field Documentation

const char* SoundIo::app_name

Optional: Application name.

PulseAudio uses this for "application name". JACK uses this for client_name. Must not contain a colon (":").

enum SoundIoBackend SoundIo::current_backend


After calling soundio_connect or soundio_connect_backend, this field tells which backend is currently connected.

backend_disconnect_recover.c, and sio_sine.c.
void(* SoundIo::emit_rtprio_warning)(void)

Optional: Real time priority warning.

This callback is fired when making thread real-time priority failed. By default, it will print to stderr only the first time it is called a message instructing the user how to configure their system to allow real-time priority threads. This must be set to a function not NULL. To silence the warning, assign this to a function that does nothing.

void(* SoundIo::jack_error_callback)(const char *msg)

Optional: JACK error callback.

See SoundIo::jack_info_callback

void(* SoundIo::jack_info_callback)(const char *msg)

Optional: JACK info callback.

By default, libsoundio sets this to an empty function in order to silence stdio messages from JACK. You may override the behavior by setting this to NULL or providing your own function. This is registered with JACK regardless of whether soundio_connect_backend succeeds.

void(* SoundIo::on_backend_disconnect)(struct SoundIo *, int err)

Optional callback.

Called when the backend disconnects. For example, when the JACK server shuts down. When this happens, listing devices and opening streams will always fail with SoundIoErrorBackendDisconnected. This callback is only called during a call to soundio_flush_events or soundio_wait_events. If you do not supply a callback, the default will crash your program with an error message. This callback is also called when the thread that retrieves device information runs into an unrecoverable condition such as running out of memory.

Possible errors:

void(* SoundIo::on_devices_change)(struct SoundIo *)

Optional callback.

Called when the list of devices change. Only called during a call to soundio_flush_events or soundio_wait_events.

void(* SoundIo::on_events_signal)(struct SoundIo *)

Optional callback.

Called from an unknown thread that you should not use to call any soundio functions. You may use this to signal a condition variable to wake up. Called when soundio_wait_events would be woken up.

void* SoundIo::userdata

Optional. Put whatever you want here. Defaults to NULL.

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