Vuo  0.9.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Typedefs | Functions
VuoAudioFile.c File Reference

Description

VuoAudio implementation.

Classes

struct  VuoAudioFileInternal
 Context data for decoding an audio file. More...
 

Typedefs

typedef struct
VuoAudioFileInternal
VuoAudioFileInternal
 Context data for decoding an audio file.
 

Functions

static char * stringWithOSStatus (OSStatus error)
 Returns a string providing a (slightly) better explanation of error.
 
static void VuoAudioFile_decodeChannels (VuoAudioFileInternal afi)
 Decodes a sample buffer for each channel, and fires the trigger port.
 
void VuoAudioFile_free (void *af)
 Deallocates the audio file decoder.
 
VuoAudioFile VuoAudioFile_make (VuoText url)
 Creates a new audio file decoder, and starts a decoding timer.
 
bool VuoAudioFile_getInfo (VuoText url, VuoReal *duration, VuoInteger *channelCount, VuoReal *sampleRate)
 Returns information about the specified audio file.
 
void VuoAudioFile_enableTriggers (VuoAudioFile af, void(*decodedChannels)(VuoList_VuoAudioSamples), void(*finishedPlayback)(void))
 Specifies a trigger callback to invoke when a new audio sample buffer is ready for playback.
 
void VuoAudioFile_disableTriggers (VuoAudioFile af)
 When this function returns, the trigger callback will no longer be called.
 
void VuoAudioFile_setLoopType (VuoAudioFile af, VuoLoopType loop)
 Sets the behavior upon reaching the end of the audio file.
 
void VuoAudioFile_setTime (VuoAudioFile af, VuoReal time)
 Seeks the playhead to the specified time in the audio file.
 
void VuoAudioFile_play (VuoAudioFile af)
 Starts or resumes playback of the audio file from the current playhead time.
 
void VuoAudioFile_pause (VuoAudioFile af)
 Pauses playback of the audio file, leaving the playhead at its current time.
 
bool VuoAudioFile_isPlaying (VuoAudioFile af)
 Returns true if the audio file is currently playing.
 

Typedef Documentation

Context data for decoding an audio file.

Function Documentation

static char* stringWithOSStatus ( OSStatus  error)
static

Returns a string providing a (slightly) better explanation of error.

static void VuoAudioFile_decodeChannels ( VuoAudioFileInternal  afi)
static

Decodes a sample buffer for each channel, and fires the trigger port.

<

Todo:
https://b33p.net/kosada/node/4726#comment-27512
void VuoAudioFile_disableTriggers ( VuoAudioFile  af)

When this function returns, the trigger callback will no longer be called.

Does not change playback status.

void VuoAudioFile_enableTriggers ( VuoAudioFile  af,
void(*)(VuoList_VuoAudioSamples decodedChannels,
void(*)(void)  finishedPlayback 
)

Specifies a trigger callback to invoke when a new audio sample buffer is ready for playback.

Does not change playback status.

void VuoAudioFile_free ( void *  af)

Deallocates the audio file decoder.

bool VuoAudioFile_getInfo ( VuoText  url,
VuoReal duration,
VuoInteger channelCount,
VuoReal sampleRate 
)

Returns information about the specified audio file.

Returns true on success, false if the file couldn't be read.

bool VuoAudioFile_isPlaying ( VuoAudioFile  af)

Returns true if the audio file is currently playing.

This is independent of whether a trigger callback is currently active.

VuoAudioFile VuoAudioFile_make ( VuoText  url)

Creates a new audio file decoder, and starts a decoding timer.

<

Todo:
https://b33p.net/kosada/node/4726#comment-27512

<

Todo:
https://b33p.net/kosada/node/4726#comment-27512
void VuoAudioFile_pause ( VuoAudioFile  af)

Pauses playback of the audio file, leaving the playhead at its current time.

void VuoAudioFile_play ( VuoAudioFile  af)

Starts or resumes playback of the audio file from the current playhead time.

void VuoAudioFile_setLoopType ( VuoAudioFile  af,
VuoLoopType  loop 
)

Sets the behavior upon reaching the end of the audio file.

void VuoAudioFile_setTime ( VuoAudioFile  af,
VuoReal  time 
)

Seeks the playhead to the specified time in the audio file.