AgsAudioSignal

AgsAudioSignal — Contains the audio data and its alignment

Functions

Properties

guint attack Read / Write
guint buffer-size Read / Write
gdouble delay Read / Write
guint first-frame Read / Write
guint format Read / Write
guint last-frame Read / Write
guint length Read / Write
guint loop-end Read / Write
guint loop-start Read / Write
GObject * note Read / Write
AgsRecallID * recall-id Read / Write
AgsRecycling * recycling Read / Write
guint samplerate Read / Write
GObject * soundcard Read / Write
gpointer stream Read / Write
gpointer stream-current Read / Write
gpointer stream-end Read / Write
guint word-size Read / Write

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── AgsAudioSignal

Implemented Interfaces

AgsAudioSignal implements AgsConnectable.

Includes

#include <ags/audio/ags_audio_signal.h>

Description

AgsAudioSignal organizes audio data within a GList whereby data pointing to the buffer.

Functions

ags_stream_alloc ()

signed short *
ags_stream_alloc (guint buffer_size);

Allocs an audio buffer.

Parameters

buffer_size

the buffer size

 

Returns

the audio data array

Since: 0.3


ags_stream_free ()

void
ags_stream_free (signed short *buffer);


ags_audio_signal_set_samplerate ()

void
ags_audio_signal_set_samplerate (AgsAudioSignal *audio_signal,
                                 guint samplerate);

Set samplerate.

Parameters

audio_signal

the AgsAudioSignal

 

samplerate

the samplerate

 

Since: 0.7.45


ags_audio_signal_set_buffer_size ()

void
ags_audio_signal_set_buffer_size (AgsAudioSignal *audio_signal,
                                  guint buffer_size);

Set buffer size.

Parameters

audio_signal

the AgsAudioSignal

 

buffer_size

the buffer size

 

Since: 0.7.45


ags_audio_signal_set_format ()

void
ags_audio_signal_set_format (AgsAudioSignal *audio_signal,
                             guint format);

Set format.

Parameters

audio_signal

the AgsAudioSignal

 

format

the format

 

Since: 0.7.45


ags_audio_signal_get_length_till_current ()

guint
ags_audio_signal_get_length_till_current
                               (AgsAudioSignal *audio_signal);

Counts the buffers from stream_beginning upto stream_current.

Parameters

audio_signal

an AgsAudioSignal

 

Returns

the counted length.

Since: 0.4


ags_audio_signal_add_stream ()

void
ags_audio_signal_add_stream (AgsAudioSignal *audio_signal);

Adds a buffer at the end of the stream.

Parameters

audio_signal

an AgsAudioSignal

 

Since: 0.3


ags_audio_signal_stream_resize ()

void
ags_audio_signal_stream_resize (AgsAudioSignal *audio_signal,
                                guint length);

Resizes an AgsAudioSignal's stream but be carefull with shrinking. This function may crash the application.

Parameters

audio_signal

an AgsAudioSignal to resize.

 

length

a guint as the new length.

 

Since: 0.3


ags_audio_signal_stream_safe_resize ()

void
ags_audio_signal_stream_safe_resize (AgsAudioSignal *audio_signal,
                                     guint length);

Resizes an AgsAudioSignal's stream but doesn't shrink more than the current stream position.

Parameters

audio_signal

an AgsAudioSignal

 

length

a guint

 

Since: 0.4


ags_audio_signal_realloc_buffer_size ()

void
ags_audio_signal_realloc_buffer_size (AgsAudioSignal *audio_signal,
                                      guint buffer_size);

Realloc the stream to the new buffer size.

Parameters

audio_signal

an AgsAudioSignal

 

buffer_size

the buffer size

 

Since: 0.4


ags_audio_signal_morph_samplerate ()

void
ags_audio_signal_morph_samplerate (AgsAudioSignal *audio_signal,
                                   guint samplerate,
                                   double k_morph);

Morph audio quality to new samplerate.

Parameters

audio_signal

an AgsAudioSignal

 

samplerate

the new samplerate

 

k_morph

reserved for future usage

 

Since: 0.4


ags_audio_signal_copy_buffer_to_buffer ()

void
ags_audio_signal_copy_buffer_to_buffer
                               (signed short *destination,
                                guint dchannels,
                                signed short *source,
                                guint schannels,
                                guint size);

Copy a buffer to an other buffer.

Parameters

destination

destination buffer

 

dchannels

destination audio channels

 

source

source buffer

 

schannels

source audio channels

 

size

frame count to copy

 

Since: 0.3


ags_audio_signal_copy_buffer_to_double_buffer ()

void
ags_audio_signal_copy_buffer_to_double_buffer
                               (double *destination,
                                guint dchannels,
                                signed short *source,
                                guint schannels,
                                guint size);

Copy a buffer to an other buffer.

Parameters

destination

destination buffer

 

dchannels

destination audio channels

 

source

source buffer

 

schannels

source audio channels

 

size

frame count to copy

 

Since: 0.4


ags_audio_signal_copy_double_buffer_to_buffer ()

void
ags_audio_signal_copy_double_buffer_to_buffer
                               (signed short *destination,
                                guint dchannels,
                                double *source,
                                guint schannels,
                                guint size);

Copy a buffer to an other buffer.

Parameters

destination

destination buffer

 

dchannels

destination audio channels

 

source

source buffer

 

schannels

source audio channels

 

size

frame count to copy

 

Since: 0.4


ags_audio_signal_duplicate_stream ()

void
ags_audio_signal_duplicate_stream (AgsAudioSignal *audio_signal,
                                   AgsAudioSignal *template);

Copy stream of one audio signal to another

Parameters

audio_signal

destination AgsAudioSignal

 

template

source AgsAudioSignal

 

Since: 0.3


ags_audio_signal_get_template ()

AgsAudioSignal *
ags_audio_signal_get_template (GList *audio_signal);

Retrieve the template audio signal.

Parameters

audio_signal

a GList containing AgsAudioSignal

 

Returns

the template AgsAudioSignal

Since: 0.3


ags_audio_signal_get_stream_current ()

GList *
ags_audio_signal_get_stream_current (GList *audio_signal,
                                     GObject *recall_id);

Retrieve next current stream of AgsAudioSignal list.

Parameters

audio_signal

a GList containing AgsAudioSignal

 

recall_id

the matching AgsRecallID

 

Returns

next GList matching AgsRecallID

Since: 0.4


ags_audio_signal_get_by_recall_id ()

GList *
ags_audio_signal_get_by_recall_id (GList *audio_signal,
                                   GObject *recall_id);

Retrieve next audio signal refering to recall_id

Parameters

audio_signal

a GList containing AgsAudioSignal

 

recall_id

matching AgsRecallID

 

Returns

matching AgsAudioSignal

Since: 0.3


ags_audio_signal_tile ()

void
ags_audio_signal_tile (AgsAudioSignal *audio_signal,
                       AgsAudioSignal *template,
                       guint frame_count);

Tile audio signal data.

Parameters

audio_signal

an AgsAudioSignal

 

template

the source AgsAudioSignal

 

frame_count

new frame count

 

Since: 0.4


ags_audio_signal_scale ()

void
ags_audio_signal_scale (AgsAudioSignal *audio_signal,
                        AgsAudioSignal *template,
                        guint length);

Scale audio signal data.

Parameters

audio_signal

an AgsAudioSignal

 

template

the source AgsAudioSignal

 

length

new frame count

 

Since: 0.4


ags_audio_signal_envelope ()

void
ags_audio_signal_envelope (AgsAudioSignal *audio_signal,
                           gdouble attack,
                           gdouble decay,
                           gdouble sustain,
                           gdouble release,
                           gdouble ratio);

Envelope audio signal.

Parameters

audio_signal

the AgsAudioSignal

 

attack

the attack

 

decay

the decay

 

sustain

the sustain

 

release

the release

 

ratio

the ratio

 

Since: 0.6.7


ags_audio_signal_new ()

AgsAudioSignal *
ags_audio_signal_new (GObject *soundcard,
                      GObject *recycling,
                      GObject *recall_id);

Creates a AgsAudioSignal, with defaults of soundcard , linking recycling tree and refering to recall_id .

Parameters

soundcard

the assigned AgsSoundcard

 

recycling

the AgsRecycling

 

recall_id

the AgsRecallID, it can be NULL if AGS_AUDIO_SIGNAL_TEMPLATE is set

 

Returns

a new AgsAudioSignal

Since: 0.3


ags_audio_signal_new_with_length ()

AgsAudioSignal *
ags_audio_signal_new_with_length (GObject *soundcard,
                                  GObject *recycling,
                                  GObject *recall_id,
                                  guint length);

Creates a AgsAudioSignal, with defaults of soundcard , linking recycling tree and refering to recall_id . The audio data is tiled to length frame count.

Parameters

soundcard

the assigned AgsSoundcard

 

recycling

the AgsRecycling

 

recall_id

the AgsRecallID, it can be NULL if AGS_AUDIO_SIGNAL_TEMPLATE is set

 

length

audio data frame count

 

Returns

a new AgsAudioSignal

Since: 0.4

Types and Values

enum AgsAudioSignalFlags

Members

AGS_AUDIO_SIGNAL_TEMPLATE

   

AGS_AUDIO_SIGNAL_PLAY_DONE

   

AGS_AUDIO_SIGNAL_STANDALONE

   

Property Details

The “attack” property

  “attack”                   guint

The attack to be used.

Flags: Read / Write

Allowed values: <= 65535

Default value: 0

Since: 0.7.2


The “buffer-size” property

  “buffer-size”              guint

The buffer size to be used.

Flags: Read / Write

Default value: 0

Since: 0.7.2


The “delay” property

  “delay”                    gdouble

The delay to be used.

Flags: Read / Write

Allowed values: [0,65535]

Default value: 0

Since: 0.7.2


The “first-frame” property

  “first-frame”              guint

The first frame of the stream.

Flags: Read / Write

Default value: 0

Since: 0.7.2


The “format” property

  “format”                   guint

The format to be used.

Flags: Read / Write

Default value: 0

Since: 0.7.2


The “last-frame” property

  “last-frame”               guint

The last frame of the stream.

Flags: Read / Write

Default value: 0

Since: 0.7.2


The “length” property

  “length”                   guint

The length of the stream.

Flags: Read / Write

Default value: 0

Since: 0.7.2


The “loop-end” property

  “loop-end”                 guint

The loop end of the stream.

Flags: Read / Write

Default value: 0

Since: 0.7.2


The “loop-start” property

  “loop-start”               guint

The loop start of the stream.

Flags: Read / Write

Default value: 0

Since: 0.7.2


The “note” property

  “note”                     GObject *

The note it is assigned with.

Flags: Read / Write

Since: 0.4.0


The “recall-id” property

  “recall-id”                AgsRecallID *

The recall id it is assigned with.

Flags: Read / Write

Since: 0.4.0


The “recycling” property

  “recycling”                AgsRecycling *

The recycling it is assigned with.

Flags: Read / Write

Since: 0.4.0


The “samplerate” property

  “samplerate”               guint

The samplerate to be used.

Flags: Read / Write

Default value: 0

Since: 0.7.2


The “soundcard” property

  “soundcard”                GObject *

The soundcard it is assigned with.

Flags: Read / Write

Since: 0.4.0


The “stream” property

  “stream”                   gpointer

The stream it contains.

Flags: Read / Write

Since: 0.7.2


The “stream-current” property

  “stream-current”           gpointer

The current stream.

Flags: Read / Write

Since: 0.7.2


The “stream-end” property

  “stream-end”               gpointer

The stream's end.

Flags: Read / Write

Since: 0.7.2


The “word-size” property

  “word-size”                guint

The word size of a frame.

Flags: Read / Write

Default value: 0

Since: 0.7.2

Signal Details

The “morph-samplerate” signal

void
user_function (AgsAudioSignal *audio_signal,
               guint           samplerate,
               gdouble         arg2,
               gpointer        user_data)

Flags: Run Last


The “realloc-buffer-size” signal

void
user_function (AgsAudioSignal *audio_signal,
               guint           buffer_size,
               gpointer        user_data)

Flags: Run Last