Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes

ucc::audiofile Class Reference

Basic audio file access class. More...

#include <audio.h>

Inheritance diagram for ucc::audiofile:
Inheritance graph
[legend]
Collaboration diagram for ucc::audiofile:
Collaboration graph
[legend]

Static Public Member Functions

static bool access (audiobuffer *buffer, const char *path, timeout_t preferred=0)
 Access an existing audio file to play.
static bool append (audiobuffer *buffer, const char *path, timeout_t preferred=0)
 Append audio to an existing file.
static bool create (audiobuffer *buffer, const char *path, timeout_t preferred=0, const char *note=NULL, const audiocodec *encoding=NULL, unsigned mode=0640)
 Create a new file to record audio into.
static bool info (audiobuffer *buffer, const char *path, timeout_t framing=0)

Protected Types

enum  { RAW, AU, RIFF, WAV }

Protected Member Functions

bool append (void)
bool flush (void)
fd_t handle (void)
timeout_t length (void)
timeout_t locate (void)
void open (const char *path, fsys::access_t access, size_t objsize, timeout_t framing)
 operator bool ()
bool rewind (void)
bool seek (timeout_t position)
timeout_t skip (timeout_t offset)
bool trim (timeout_t backup)

Protected Attributes

unsigned bufend
size_t bufio
unsigned bufpos
fsys::offset_t current
enum ucc::audiofile:: { ... }  filetype
fsys fs
uint8_t header [40]
fsys::offset_t headersize
fsys::offset_t hiwater
size_t maxio
size_t minio

Detailed Description

Basic audio file access class.

This holds common methods used for manipulating audio files through frame buffering. Additional reader and writer objects are derived to handle file access specific to each.

Author:
David Sugar <dyfet@gnutelephony.org>

Definition at line 369 of file audio.h.


Member Function Documentation

static bool ucc::audiofile::access ( audiobuffer buffer,
const char *  path,
timeout_t  preferred = 0 
) [static]

Access an existing audio file to play.

Parameters:
buffer to stream frames through.
path of file to access.
preferred I/O framing.
Returns:
true if success.
static bool ucc::audiofile::append ( audiobuffer buffer,
const char *  path,
timeout_t  preferred = 0 
) [static]

Append audio to an existing file.

Parameters:
buffer to use for appending frames.
path of file to append.
preferred I/O framing.
Returns:
true if success.
static bool ucc::audiofile::create ( audiobuffer buffer,
const char *  path,
timeout_t  preferred = 0,
const char *  note = NULL,
const audiocodec encoding = NULL,
unsigned  mode = 0640 
) [static]

Create a new file to record audio into.

Parameters:
buffer to stream frames through.
path of file to access.
preferred I/O framing.
note to attach if format allows, NULL if none.
encoding of target or 0 for default.
mode of access for new file.
Returns:
true if success.

The documentation for this class was generated from the following file: