AgsAudioFile

AgsAudioFile — Audio file input/output

Functions

Properties

guint audio-channels Read / Write
AgsAudioSignal * audio-signal Read / Write
guint buffer-size Read / Write
gchar * filename Read / Write
GObject * playable Read / Write
guint samplerate Read / Write
GObject * soundcard Read / Write
guint start-channel Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── AgsAudioFile

Implemented Interfaces

AgsAudioFile implements AgsConnectable.

Includes

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

Description

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

Functions

ags_audio_file_check_suffix ()

gboolean
ags_audio_file_check_suffix (gchar *filename);


ags_audio_file_open ()

gboolean
ags_audio_file_open (AgsAudioFile *audio_file);

Open the AgsAudioFile in read mode.

Parameters

audio_file

the AgsAudioFile

 

Returns

TRUE on success, otherwise FALSE

Since: 0.3


ags_audio_file_open_from_data ()

gboolean
ags_audio_file_open_from_data (AgsAudioFile *audio_file,
                               gchar *data);

Open AgsAudioFile using virtual functions.

Parameters

audio_file

the AgsAudioFile

 

data

the audio data

 

Returns

TRUE on success, otherwise FALSE

Since: 0.4


ags_audio_file_rw_open ()

gboolean
ags_audio_file_rw_open (AgsAudioFile *audio_file,
                        gboolean create);

Open the AgsAudioFile in read/write mode.

Parameters

audio_file

the AgsAudioFile

 

create

create the file

 

Returns

TRUE on success, otherwise FALSE

Since: 0.4.2


ags_audio_file_close ()

void
ags_audio_file_close (AgsAudioFile *audio_file);

Close the AgsAudioFile.

Parameters

audio_file

the AgsAudioFile

 

Since: 0.3


ags_audio_file_read_audio_signal ()

void
ags_audio_file_read_audio_signal (AgsAudioFile *audio_file);

Convert the AgsAudioFile to a GList of buffers.

Parameters

audio_file

the AgsAudioFile

 

Since: 0.3


ags_audio_file_seek ()

void
ags_audio_file_seek (AgsAudioFile *audio_file,
                     guint frames,
                     gint whence);

Position the AgsAudioFile's internal data address.

Parameters

audio_file

the AgsAudioFile

 

frames

number of frames to seek

 

whence

SEEK_SET, SEEK_CUR, or SEEK_END

 

Since: 0.4


ags_audio_file_write ()

void
ags_audio_file_write (AgsAudioFile *audio_file,
                      void *buffer,
                      guint buffer_size,
                      guint format);

Write the buffer to AgsAudioFile.

Parameters

audio_file

the AgsAudioFile

 

buffer

the audio data

 

buffer_size

the count of frames to write

 

Since: 0.4


ags_audio_file_flush ()

void
ags_audio_file_flush (AgsAudioFile *audio_file);

Flushes the AgsAudioFile's internal buffer.

Parameters

audio_file

the AgsAudioFile

 

Since: 0.4


ags_audio_file_new ()

AgsAudioFile *
ags_audio_file_new (gchar *filename,
                    GObject *soundcard,
                    guint start_channel,
                    guint audio_channels);

Creates an AgsAudioFile.

Parameters

filename

the filename

 

soundcard

defaults of AgsSoundcard

 

start_channel

ommited channels

 

audio_channels

number of channels to read

 

Returns

an empty AgsAudioFile.

Since: 0.3


AGS_AUDIO_FILE()

#define AGS_AUDIO_FILE(obj)                (G_TYPE_CHECK_INSTANCE_CAST((obj), AGS_TYPE_AUDIO_FILE, AgsAudioFile))


AGS_AUDIO_FILE_CLASS()

#define AGS_AUDIO_FILE_CLASS(class)        (G_TYPE_CHECK_CLASS_CAST((class), AGS_TYPE_AUDIO_FILE, AgsAudioFileClass))


AGS_AUDIO_FILE_GET_CLASS()

#define AGS_AUDIO_FILE_GET_CLASS(obj)      (G_TYPE_INSTANCE_GET_CLASS((obj), AGS_TYPE_AUDIO_FILE, AgsAudioFileClass))


AGS_IS_AUDIO_FILE()

#define AGS_IS_AUDIO_FILE(obj)             (G_TYPE_CHECK_INSTANCE_TYPE((obj), AGS_TYPE_AUDIO_FILE))


AGS_IS_AUDIO_FILE_CLASS()

#define AGS_IS_AUDIO_FILE_CLASS(class)     (G_TYPE_CHECK_CLASS_TYPE((class), AGS_TYPE_AUDIO_FILE))


ags_audio_file_get_type ()

GType
ags_audio_file_get_type ();

Types and Values

AGS_TYPE_AUDIO_FILE

#define AGS_TYPE_AUDIO_FILE                (ags_audio_file_get_type())


struct AgsAudioFile

struct AgsAudioFile;


struct AgsAudioFileClass

struct AgsAudioFileClass {
  GObjectClass object;
};

Property Details

The “audio-channels” property

  “audio-channels”           guint

The audio file's count of channels to be read.

Flags: Read / Write

Default value: 1

Since: 0.4.3


The “audio-signal” property

  “audio-signal”             AgsAudioSignal *

The containing AgsAudioSignal.

Flags: Read / Write

Since: 0.4.3


The “buffer-size” property

  “buffer-size”              guint

The buffer size to be used.

Flags: Read / Write

Allowed values: <= 65535

Default value: 0

Since: 0.4.3


The “filename” property

  “filename”                 gchar *

The assigned filename.

Flags: Read / Write

Default value: NULL

Since: 0.4.3


The “playable” property

  “playable”                 GObject *

The containing AgsAudioSignal.

Flags: Read / Write

Since: 0.4.3


The “samplerate” property

  “samplerate”               guint

The samplerate to be used.

Flags: Read / Write

Allowed values: <= 65535

Default value: 0

Since: 0.4.3


The “soundcard” property

  “soundcard”                GObject *

The assigned soundcard.

Flags: Read / Write

Since: 0.4.3


The “start-channel” property

  “start-channel”            guint

The audio file's offset to start reading from.

Flags: Read / Write

Default value: 0

Since: 0.4.3