#include <stdint.h>
Go to the source code of this file.
#define AUDIO_DEVICE_NAME_LENGTH 20 |
Definition at line 26 of file audio.h.
Referenced by audio_device_name_set(), load_config_file(), and on_morse2txt_properties_apply().
#define AUDIO_DEVICE_TEMINATOR {0, NULL, NULL, NULL, NULL, NULL} |
typedef void(* audio_error_message_handler)(char *error_message) |
typedef void(* message_handler)(char *message) |
typedef struct ts_audio_api* p_audio_api |
typedef struct ts_audio_device* p_audio_device |
typedef struct ts_audio_pub * p_audio_pub |
enum te_audio_channels |
enum te_audio_rec_play |
enum te_audio_segments |
Audio segments used in audio record/playback
void audio_capture | ( | p_audio_device | device, | |
te_audio_segments | buffer_segment | |||
) |
Capture raw audio data from audio device.
device | The audio device object. |
buffer_segment | The buffer segment to put data into. |
Definition at line 150 of file audio.c.
References ts_audio_device::audio_api, ts_audio_device::audio_pub, ts_audio_api::record, and ts_audio_device::segment_cond_t.
Referenced by data_collection().
void audio_capture_wait | ( | p_audio_device | device, | |
te_audio_segments | buffer_segment | |||
) |
Blocking function that releases when buffer segment has been captured.
device | The audio device object. |
buffer_segment | The buffer segment capture to wait on. |
Definition at line 158 of file audio.c.
References ts_audio_device::segment_cond_t, and ts_audio_device::segment_mutex_t.
Referenced by audio_post_process().
int32_t audio_close | ( | p_audio_device | device | ) |
Close audio device.
device | Pointer to audio device object. |
Definition at line 117 of file audio.c.
References ts_audio_device::audio_api, ts_audio_device::audio_pub, and ts_audio_api::close.
Referenced by free_all().
p_audio_device audio_create | ( | uint32_t | device_type, | |
te_audio_rec_play | rec_play | |||
) |
Creates an audio object.
device_type | OSS, ALSA, ... | |
rec_play | REcord or Playback device. |
Definition at line 66 of file audio.c.
References ts_audio_device::audio_api, ts_audio_pub::audio_buffer_raw, AUDIO_BUFFER_SEGMENTS, AUDIO_NUMBER_OF_DEVICE_TYPES, ts_audio_device::audio_pub, error_message(), ts_audio_pub::error_msg_handler, ts_audio_pub::play_record, ts_audio_device::segment_cond_t, and ts_audio_device::segment_mutex_t.
Referenced by audio_loopback_start(), and morse_initialize().
int32_t audio_destroy | ( | p_audio_device * | device | ) |
Close and release audio device.
device | Pointer to audio device object. |
Definition at line 137 of file audio.c.
Referenced by audio_loopback_stop(), and morse_shutdown().
void audio_device_name_get | ( | p_audio_device | device, | |
char ** | name | |||
) |
Get the audio device name, i.e. /dev/dsp.
device | Pointer to the audio device | |
name | Destination for audio device name. |
Definition at line 264 of file audio.c.
References ts_audio_device::audio_pub, and ts_audio_pub::name.
Referenced by on_morse2txt_properties_show(), and save_config_file().
void audio_device_name_set | ( | p_audio_device | device, | |
const char * | name | |||
) |
Set the audio device name, i.e. /dev/dsp.
device | Pointer to the audio device | |
name | Audio device name to set. |
Definition at line 257 of file audio.c.
References AUDIO_DEVICE_NAME_LENGTH, ts_audio_device::audio_pub, and ts_audio_pub::name.
Referenced by load_config_file(), and on_morse2txt_properties_apply().
uint32_t audio_device_samples_get | ( | p_audio_device | device | ) |
Returns the samples that will be captured by the audio device.
device | Pointer to the audio device |
Definition at line 220 of file audio.c.
References ts_audio_device::audio_pub, and ts_audio_pub::samples.
Referenced by audio_loopback_start(), audio_post_process(), morse_code(), morse_create_fft_amp_array(), and morse_start_threads().
char* audio_device_type_name_get | ( | int32_t | audio_device_type_id | ) |
Get the name of audio device type.
audio_device_type_id | Device type Id. |
Definition at line 249 of file audio.c.
References ts_audio_api::audio_device_type_name.
Referenced by on_morse2txt_properties_show().
void audio_double2raw | ( | p_audio_device | device, | |
te_audio_segments | buffer_segment, | |||
double * | audio_data | |||
) |
Converts double audio data to raw for soundcard.
device | The audio device object. | |
buffer_segment | the buffer segment to convert to fill with raw. | |
audio_data | Pointer to double formatted audio data. |
Definition at line 197 of file audio.c.
References ts_audio_pub::audio_buffer_raw, ts_audio_pub::audio_buffer_size, ts_audio_device::audio_pub, and ts_audio_pub::dsp_channels.
Referenced by audio_loopback_convert_thr().
int32_t audio_init | ( | p_audio_device | device | ) |
Initialize audio device.
device | Pointer to audio device object. |
Definition at line 127 of file audio.c.
References ts_audio_device::audio_api, ts_audio_device::audio_pub, and ts_audio_api::init.
Referenced by audio_loopback_start().
int32_t audio_open | ( | p_audio_device | device, | |
int32_t | sample_frequency | |||
) |
Open audio device.
device | Pointer to audio device object. |
sample_frequency | Sample frequency in Hertz. |
Definition at line 101 of file audio.c.
References ts_audio_device::audio_api, ts_audio_device::audio_pub, ts_audio_api::init, ts_audio_api::open, and ts_audio_pub::sample_frequency.
Referenced by audio_loopback_start(), and morse_start_threads().
void audio_play | ( | p_audio_device | device, | |
te_audio_segments | buffer_segment | |||
) |
Send raw audio data to audio device.
device | The audio device object. |
buffer_segment | The buffer segment to play. |
Definition at line 165 of file audio.c.
References ts_audio_device::audio_api, ts_audio_device::audio_pub, and ts_audio_api::play.
Referenced by audio_loopback_thr().
void audio_raw2double | ( | p_audio_device | device, | |
te_audio_segments | buffer_segment, | |||
double * | audio_data | |||
) |
Converts the raw audio data to real.
device | The audio device object. |
buffer_segment | the buffer segment to convert to real. | |
audio_data | Pointer to scaled audio data. |
Definition at line 172 of file audio.c.
References ts_audio_pub::audio_buffer_raw, ts_audio_pub::audio_buffer_size, ts_audio_device::audio_pub, ts_audio_pub::dsp_channels, and ts_audio_device::segment_mutex_t.
Referenced by audio_post_process().
int32_t audio_sample_rate_get | ( | p_audio_device | device | ) |
Get the audio sample rate.
Definition at line 281 of file audio.c.
References ts_audio_device::audio_pub, and ts_audio_pub::sample_frequency.
Referenced by morse_start_threads().
void audio_sample_rate_set | ( | p_audio_device | device, | |
int32_t | Hertz | |||
) |
Set the audio device sample rate.
device | Pointer to the audio device | |
Hertz | Frequency in Hertz. |
Definition at line 274 of file audio.c.
References ts_audio_device::audio_pub, and ts_audio_pub::sample_frequency.
int32_t audio_supported_device_types_get | ( | void | ) |
Get the number of audio device types supported (OSS, Alsa, etc.).
Definition at line 244 of file audio.c.
References AUDIO_NUMBER_OF_DEVICE_TYPES.
void register_error_message_handler | ( | message_handler | handler | ) |
Used to register an external error message handler function.
Definition at line 299 of file audio.c.
References msg_handler.
Referenced by init_gui_interface_hooks().