AgsAudioContainer

AgsAudioContainer — Audio container input/output

Stability Level

Stable, unless otherwise indicated

Functions

Properties

int audio-channel Read / Write
gpointer audio-signal Read / Write
guint buffer-size Read / Write
guint file-audio-channels Read / Write
guint file-frame-count Read / Write
guint file-samplerate Read / Write
char * filename Read / Write
guint format Read / Write
char * instrument Read / Write
char * preset Read / Write
char * sample Read / Write
guint samplerate Read / Write
GObject * soundcard Read / Write
gpointer wave Read / Write

Object Hierarchy

    GObject
    ╰── AgsAudioContainer

Includes

#include <ags/audio/file/ags_audio_container.h>

Description

AgsAudioContainer is the base object to read/write audio data.

Functions

AGS_AUDIO_CONTAINER_GET_OBJ_MUTEX()

#define AGS_AUDIO_CONTAINER_GET_OBJ_MUTEX(obj) (&(((AgsAudioContainer *) obj)->obj_mutex))

ags_audio_container_check_suffix ()

gboolean
ags_audio_container_check_suffix (gchar *filename);

Check suffix.

Parameters

filename

the filename

 

Returns

TRUE if suffix supported, else FALSE

Since: 3.0.0


ags_audio_container_find_sound_resource ()

GList *
ags_audio_container_find_sound_resource
                               (AgsAudioContainer *audio_container,
                                gchar *preset,
                                gchar *instrument,
                                gchar *sample);

Find resource specified by parameters.

Parameters

audio_container

the AgsAudioContainer

 

preset

the preset

 

instrument

the instrument

 

sample

the sample

 

Returns

the GList containing GObject sample or NULL. WARNING the parameters need to be valid in order to return the correct list.

[element-type GObject][transfer full]

Since: 3.0.0


ags_audio_container_add_audio_signal ()

void
ags_audio_container_add_audio_signal (AgsAudioContainer *audio_container,
                                      GObject *audio_signal);

Add audio_signal to audio_container .

Parameters

audio_container

the AgsAudioContainer

 

audio_signal

the AgsAudioSignal

 

Since: 3.0.0


ags_audio_container_remove_audio_signal ()

void
ags_audio_container_remove_audio_signal
                               (AgsAudioContainer *audio_container,
                                GObject *audio_signal);

Remove audio_signal from audio_container .

Parameters

audio_container

the AgsAudioContainer

 

audio_signal

the AgsAudioSignal

 

Since: 3.0.0


ags_audio_container_add_wave ()

void
ags_audio_container_add_wave (AgsAudioContainer *audio_container,
                              GObject *wave);

Add wave to audio_container .

Parameters

audio_container

the AgsAudioContainer

 

wave

the AgsWave

 

Since: 3.0.0


ags_audio_container_remove_wave ()

void
ags_audio_container_remove_wave (AgsAudioContainer *audio_container,
                                 GObject *wave);

Remove wave from audio_container .

Parameters

audio_container

the AgsAudioContainer

 

wave

the AgsWave

 

Since: 3.0.0


ags_audio_container_open ()

gboolean
ags_audio_container_open (AgsAudioContainer *audio_container);

Open the AgsAudioContainer in read mode.

Parameters

audio_container

the AgsAudioContainer

 

Returns

TRUE on success, otherwise FALSE

Since: 3.0.0


ags_audio_container_open_from_data ()

gboolean
ags_audio_container_open_from_data (AgsAudioContainer *audio_container,
                                    gchar *data);

ags_audio_container_rw_open ()

gboolean
ags_audio_container_rw_open (AgsAudioContainer *audio_container,
                             gboolean create);

ags_audio_container_close ()

void
ags_audio_container_close (AgsAudioContainer *audio_container);

Close the AgsAudioContainer.

Parameters

audio_container

the AgsAudioContainer

 

Since: 3.0.0


ags_audio_container_read ()

void *
ags_audio_container_read (AgsAudioContainer *audio_container,
                          guint audio_channel,
                          AgsSoundcardFormat format,
                          GError **error);

Read audio buffer.

Parameters

audio_container

the AgsAudioContainer

 

audio_channel

nth channel

 

format

the format

 

error

returned error

 

Since: 3.0.0


ags_audio_container_read_audio_signal ()

GList *
ags_audio_container_read_audio_signal (AgsAudioContainer *audio_container);

Convert the AgsAudioContainer to a GList of AgsAudioSignal.

Parameters

audio_container

the AgsAudioContainer

 

Returns

the new GList containing AgsAudioSignal or NULL.

[element-type AgsAudio.AudioSignal][transfer full]

Since: 3.0.0


ags_audio_container_read_wave ()

GList *
ags_audio_container_read_wave (AgsAudioContainer *audio_container,
                               guint64 x_offset,
                               gdouble delay,
                               guint attack);

Convert the AgsAudioContainer to a GList of AgsWave.

Parameters

audio_container

the AgsAudioContainer

 

x_offset

the x offset

 

delay

the delay

 

attack

the attack

 

Returns

the new GList containing AgsWave or NULL.

[element-type AgsAudio.Wave][transfer full]

Since: 3.0.0


ags_audio_container_seek ()

void
ags_audio_container_seek (AgsAudioContainer *audio_container,
                          guint frames,
                          gint whence);

ags_audio_container_write ()

void
ags_audio_container_write (AgsAudioContainer *audio_container,
                           void *buffer,
                           guint buffer_size,
                           AgsSoundcardFormat format);

ags_audio_container_flush ()

void
ags_audio_container_flush (AgsAudioContainer *audio_container);

ags_audio_container_new ()

AgsAudioContainer *
ags_audio_container_new (gchar *filename,
                         gchar *preset,
                         gchar *instrument,
                         gchar *sample,
                         GObject *soundcard,
                         gint audio_channel);

Create a new instance of AgsAudioContainer.

Parameters

filename

the filename

 

preset

the preset

 

instrument

the instrument

 

sample

the sample

 

soundcard

defaults of AgsSoundcard

 

audio_channel

the audio channel to read

 

Returns

the new AgsAudioContainer.

Since: 3.0.0

Property Details

The “audio-channel” property

  “audio-channel”            int

The audio channel to be read.

Owner: AgsAudioContainer

Flags: Read / Write

Allowed values: >= -1

Default value: 0

Since: 3.0.0


The “audio-signal” property

  “audio-signal”             gpointer

The containing AgsAudioSignal.

[transfer full]

Owner: AgsAudioContainer

Flags: Read / Write

Since: 3.0.0


The “buffer-size” property

  “buffer-size”              guint

The buffer size to be used.

Owner: AgsAudioContainer

Flags: Read / Write

Default value: 0

Since: 3.0.0


The “file-audio-channels” property

  “file-audio-channels”      guint

The audio channel count of this file.

Owner: AgsAudioContainer

Flags: Read / Write

Default value: 0

Since: 3.0.0


The “file-frame-count” property

  “file-frame-count”         guint

The frame count of the file.

Owner: AgsAudioContainer

Flags: Read / Write

Default value: 0


The “file-samplerate” property

  “file-samplerate”          guint

The samplerate of this file.

Owner: AgsAudioContainer

Flags: Read / Write

Default value: 0

Since: 3.0.0


The “filename” property

  “filename”                 char *

The assigned filename.

Owner: AgsAudioContainer

Flags: Read / Write

Default value: NULL

Since: 3.0.0


The “format” property

  “format”                   guint

The format to be used.

Owner: AgsAudioContainer

Flags: Read / Write

Default value: 0

Since: 3.0.0


The “instrument” property

  “instrument”               char *

The assigned instrument.

Owner: AgsAudioContainer

Flags: Read / Write

Default value: NULL

Since: 3.0.0


The “preset” property

  “preset”                   char *

The assigned preset.

Owner: AgsAudioContainer

Flags: Read / Write

Default value: NULL

Since: 3.0.0


The “sample” property

  “sample”                   char *

The assigned sample.

Owner: AgsAudioContainer

Flags: Read / Write

Default value: NULL

Since: 3.0.0


The “samplerate” property

  “samplerate”               guint

The samplerate to be used.

Owner: AgsAudioContainer

Flags: Read / Write

Default value: 0

Since: 3.0.0


The “soundcard” property

  “soundcard”                GObject *

The assigned soundcard.

Owner: AgsAudioContainer

Flags: Read / Write

Since: 3.0.0


The “wave” property

  “wave”                     gpointer

The containing AgsWave.

[transfer full]

Owner: AgsAudioContainer

Flags: Read / Write

Since: 3.0.0