AgsAudioFile

AgsAudioFile — Audio file input/output

Synopsis

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

struct              AgsAudioFile;
struct              AgsAudioFileClass;
void                ags_audio_file_close                (AgsAudioFile *audio_file);
void                ags_audio_file_flush                (AgsAudioFile *audio_file);
AgsAudioFile *      ags_audio_file_new                  (gchar *name,
                                                         AgsDevout *devout,
                                                         guint start_channel,
                                                         guint audio_channels);
gboolean            ags_audio_file_open                 (AgsAudioFile *audio_file);
gboolean            ags_audio_file_open_from_data       (AgsAudioFile *audio_file,
                                                         gchar *data);
void                ags_audio_file_read_audio_signal    (AgsAudioFile *audio_file);
gboolean            ags_audio_file_rw_open              (AgsAudioFile *audio_file,
                                                         gboolean create);
void                ags_audio_file_seek                 (AgsAudioFile *audio_file,
                                                         guint frames,
                                                         gint whence);
void                ags_audio_file_write                (AgsAudioFile *audio_file,
                                                         signed short *buffer,
                                                         guint buffer_size);

Description

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

Details

struct AgsAudioFile

struct AgsAudioFile {
  GObject object;

  AgsDevout *devout;

  gchar *name;
  guint samplerate;
  guint frames;
  guint channels;
  guint format;

  guint start_channel;
  guint audio_channels;

  GList *audio_signal;

  GObject *file;
};

struct AgsAudioFileClass

struct AgsAudioFileClass {
  GObjectClass object;
};

ags_audio_file_close ()

void                ags_audio_file_close                (AgsAudioFile *audio_file);

Close the AgsAudioFile.

audio_file :

the AgsAudioFile

Since 0.3


ags_audio_file_flush ()

void                ags_audio_file_flush                (AgsAudioFile *audio_file);

Flushes the AgsAudioFile's internal buffer.

audio_file :

the AgsAudioFile

Since 0.4


ags_audio_file_new ()

AgsAudioFile *      ags_audio_file_new                  (gchar *name,
                                                         AgsDevout *devout,
                                                         guint start_channel,
                                                         guint audio_channels);

Creates an AgsAudioFile.

name :

the filename

devout :

defaults of AgsDevout

start_channel :

ommited channels

audio_channels :

number of channels to read

Returns :

an empty AgsAudioFile.

Since 0.3


ags_audio_file_open ()

gboolean            ags_audio_file_open                 (AgsAudioFile *audio_file);

Open the AgsAudioFile in read mode.

audio_file :

the AgsAudioFile

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.

audio_file :

the AgsAudioFile

data :

the audio data

Since 0.4


ags_audio_file_read_audio_signal ()

void                ags_audio_file_read_audio_signal    (AgsAudioFile *audio_file);

Convert the AgsAudioFile to a GList of buffers.

audio_file :

the AgsAudioFile

Since 0.3


ags_audio_file_rw_open ()

gboolean            ags_audio_file_rw_open              (AgsAudioFile *audio_file,
                                                         gboolean create);

Open the AgsAudioFile in read/write mode.

audio_file :

the AgsAudioFile

create :

create the file

Since 0.4


ags_audio_file_seek ()

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

Position the AgsAudioFile's internal data address.

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,
                                                         signed short *buffer,
                                                         guint buffer_size);

Write the buffer to AgsAudioFile.

audio_file :

the AgsAudioFile

buffer :

the audio data

buffer_size :

the count of frames to write

Since 0.4