AXaudio
axaudio.h
Go to the documentation of this file.
1 #ifndef _AX_AUDIO_H_
2 #define _AX_AUDIO_H_
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
27 #include <glib.h>
28 
33 
38 
42 typedef struct _AXAudioFrame AXAudioFrame;
43 
48 typedef enum {
52 
57 typedef enum {
64 
65 
73 guint
74 ax_audio_get_sources(guint **sources);
75 
76 
85 gboolean
86 ax_audio_get_channel_capability(guint audio_source, AXAudioChannel *channel_cap);
87 
88 
96 gint
97 ax_audio_get_codecs(AXAudioCodec **codecs);
98 
99 
109 gint
110 ax_audio_get_samplerates(gint **samplerates, AXAudioCodec codec, GError **error);
111 
112 
123 gint
124 ax_audio_get_bitrates(guint **bitrates, AXAudioCodec codec, gint samplerate, GError **error);
125 
126 
139 ax_audio_open_output_pcm_16(gint audio_sink, gint samplerate,
140  AXAudioChannel channel, GError **error);
141 
142 
155 gboolean
157  GError **error);
158 
168 gboolean
169 ax_audio_output_close_pcm_16(AXAudioOutput *output, GError **error);
170 
171 
193 ax_audio_open_pcm_16_stream(gint audio_source, gint samplerate, AXAudioChannel channel, GError **error);
194 
195 
219 ax_audio_open_opus_stream(gint bitrate, gint samplerate, gint audio_source, AXAudioChannel channel, GError **error);
220 
221 
247 ax_audio_open_aac_stream(gint bitrate, gint samplerate, gint audio_source, AXAudioChannel channel, GError **error);
248 
249 
264 ax_audio_open_g711_stream(gint audio_source, GError **error);
265 
266 
284 ax_audio_open_g726_stream(gint bitrate, gint audio_source, GError **error);
285 
286 
298 gboolean
299 ax_audio_stream_close(AXAudioStream *stream, GError **error);
300 
301 
311 gboolean
312 ax_audio_stream_get_channel_capability(const AXAudioStream *stream, AXAudioChannel *channel_cap);
313 
322 guint
324 
333 guint
335 
344 guint
346 
347 
356 guint
358 
359 
368 gboolean
369 ax_audio_stream_get_codec(const AXAudioStream *stream, AXAudioCodec *codec);
370 
371 
390 AXAudioFrame *
391 ax_audio_stream_get_frame(const AXAudioStream *stream, GError **error);
392 
393 
404 AXAudioFrame *
405 ax_audio_frame_copy(const AXAudioFrame *frame);
406 
415 AXAudioFrame *
416 ax_audio_frame_new(void);
417 
435 gboolean
436 ax_audio_frame_set_data(AXAudioFrame *frame, gpointer data, gint size,
437  GFreeFunc free_function, GError **error);
438 
439 
451 gboolean
452 ax_audio_frame_set_timestamp(AXAudioFrame *frame, guint64 timestamp, GError **error);
453 
454 
465 gpointer
467 
476 guint
478 
488 guint64
490 
499 void
501 
502 
503 #ifdef __cplusplus
504 }
505 #endif
506 
507 #endif /* _AXAUDIO_H_ */
Definition: axaudio.h:62
guint ax_audio_get_sources(guint **sources)
Retrieve a numbered list of audio sources.
Definition: ax_audio.c:524
Definition: axaudio.h:50
gint ax_audio_get_codecs(AXAudioCodec **codecs)
Retrieve a list of available codecs.
Definition: ax_audio.c:566
AXAudioStream * ax_audio_open_aac_stream(gint bitrate, gint samplerate, gint audio_source, AXAudioChannel channel, GError **error)
Open a new AAC audio stream.
Definition: ax_audio.c:400
guint ax_audio_frame_get_size(const AXAudioFrame *frame)
Retrieve the data size in bytes from the AXAudioFrame. The size is the total size, that is the sum of all channel data.
Definition: ax_audio.c:898
gboolean ax_audio_output_close_pcm_16(AXAudioOutput *output, GError **error)
Close the raw signed PCM16 audio output.
Definition: ax_audio.c:373
guint ax_audio_stream_get_period_time(const AXAudioStream *stream)
Retrieve the time between two successive audio frames.
Definition: ax_audio.c:751
AXAudioStream * ax_audio_open_pcm_16_stream(gint audio_source, gint samplerate, AXAudioChannel channel, GError **error)
Open a new raw signed PCM 16 audio stream.
Definition: ax_audio.c:384
Definition: axaudio.h:59
gboolean ax_audio_frame_set_timestamp(AXAudioFrame *frame, guint64 timestamp, GError **error)
Set the timestamp of the AXAudioFrame.
Definition: ax_audio.c:870
gboolean ax_audio_frame_set_data(AXAudioFrame *frame, gpointer data, gint size, GFreeFunc free_function, GError **error)
Set the data content of the AXAudioFrame.
Definition: ax_audio.c:845
Definition: axaudio.h:58
Definition: axaudio.h:61
guint ax_audio_stream_get_bitrate(const AXAudioStream *stream)
Retrieve the bit rate of the audio stream.
Definition: ax_audio.c:494
gboolean ax_audio_stream_get_channel_capability(const AXAudioStream *stream, AXAudioChannel *channel_cap)
Retrieve the channel capability of the audio stream, for example AX_AUDIO_CHANNEL_MONO.
Definition: ax_audio.c:772
AXAudioStream * ax_audio_open_opus_stream(gint bitrate, gint samplerate, gint audio_source, AXAudioChannel channel, GError **error)
Open a new Opus audio stream.
Definition: ax_audio.c:392
guint ax_audio_stream_get_samplerate(const AXAudioStream *stream)
Retrieve the sample rate of the audio stream.
Definition: ax_audio.c:504
void ax_audio_frame_free(AXAudioFrame *frame)
Free the AXAudioFrame retrieved from ax_audio_get_frame() or ax_audio_frame_new().
Definition: ax_audio.c:919
Definition: axaudio.h:49
gboolean ax_audio_stream_close(AXAudioStream *stream, GError **error)
Close a running audio stream.
Definition: ax_audio.c:472
gint ax_audio_get_samplerates(gint **samplerates, AXAudioCodec codec, GError **error)
Retrieve a list of available sample rates for the specified codec.
Definition: ax_audio.c:603
AXAudioFrame * ax_audio_frame_new(void)
Create an empty AXAudioFrame structure.
Definition: ax_audio.c:830
AXAudioStream * ax_audio_open_g726_stream(gint bitrate, gint audio_source, GError **error)
Open a new G.726 audio stream.
Definition: ax_audio.c:416
guint ax_audio_stream_get_bit_depth(const AXAudioStream *stream)
Retrieve the bit depth of the audio stream.
Definition: ax_audio.c:514
Definition: ax_audio_datatypes.h:17
gboolean ax_audio_stream_get_codec(const AXAudioStream *stream, AXAudioCodec *codec)
Retrieve the codec for the audio stream.
Definition: ax_audio.c:761
AXAudioFrame * ax_audio_frame_copy(const AXAudioFrame *frame)
Copy an audio frame from an open audio stream.
Definition: ax_audio.c:811
gboolean ax_audio_get_channel_capability(guint audio_source, AXAudioChannel *channel_cap)
Retrieve the channel capability of the audio source.
Definition: ax_audio.c:555
Definition: axaudio.h:60
gint ax_audio_get_bitrates(guint **bitrates, AXAudioCodec codec, gint samplerate, GError **error)
Retrieve a list of available bit rates for the specified codec and sample rate.
Definition: ax_audio.c:662
gpointer ax_audio_frame_get_data(const AXAudioFrame *frame)
Retrieve the data from the AXAudioFrame.
Definition: ax_audio.c:888
AXAudioStream * ax_audio_open_g711_stream(gint audio_source, GError **error)
Open a new G.711 audio stream.
Definition: ax_audio.c:408
AXAudioOutput * ax_audio_open_output_pcm_16(gint audio_sink, gint samplerate, AXAudioChannel channel, GError **error)
Open a raw signed PCM16 audio output.
Definition: ax_audio.c:349
Definition: ax_audio_datatypes.h:40
Definition: ax_audio_datatypes.h:25
gboolean ax_audio_output_play_pcm_16(AXAudioOutput *output, const AXAudioFrame *frame, GError **error)
Play raw signed PCM16 audio data. Interleaved LRLRLR if more than one channel is supported. This function will block until the whole frame is played.
Definition: ax_audio.c:361
AXAudioCodec
Definition: axaudio.h:57
AXAudioFrame * ax_audio_stream_get_frame(const AXAudioStream *stream, GError **error)
Retreive an audio frame from an open audio stream.
Definition: ax_audio.c:784
guint64 ax_audio_frame_get_timestamp(const AXAudioFrame *frame)
Retrieve the timestamp in nanoseconds from the AXAudioFrame.
Definition: ax_audio.c:908
AXAudioChannel
Definition: axaudio.h:48