Main Page | Class List | File List | Class Members

audiere::WSOLA4Audiere Class Reference

#include <WSOLA4Audiere.H>

List of all members.

Public Member Functions

 WSOLA4Audiere (SampleSourcePtr source, double ta=DEF_TAU, int startPoint=0, int endPoint=0, void(*lastFrameCallback_in)(void *)=NULL, void *callBackData_in=NULL)
 ~WSOLA4Audiere ()
 Deconstructor.
void ADR_CALL getFormat (int &channel_count, int &sample_rate, SampleFormat &sample_format)
 Used to get various format information like channel count, sample rate and sample format.
int ADR_CALL read (int frame_count, void *buffer)
 This overloaded function is called by Audiere to fill the output buffer.
void ADR_CALL reset ()
 Resets the source and WSOLA.
bool ADR_CALL isSeekable ()
 Checks whether the source is seekable.
int ADR_CALL getLength ()
 Returns the length of the source.
void ADR_CALL setPosition (int position)
 Set the position of both the source and WSOLA accordingly.
int ADR_CALL getPosition ()
 Position is indexed to the original stream index, as tau is variable.
bool ADR_CALL getRepeat ()
 Tells whether the source is set to repeat.
void ADR_CALL setRepeat (bool repeat)
 Sets the state of the source repeat.
void setTau (float ta)
 Sets the play back speed.
float getTau ()
 Get the playback speed.
int getTagCount ()
 Conformity with new Audiere API which supports tags : getTagCount.
const char * getTagKey (int i)
 Conformity with new Audiere API which supports tags : getTagKey.
const char * getTagValue (int i)
 Conformity with new Audiere API which supports tags : getTagValue.
const char * getTagType (int i)
 Conformity with new Audiere API which supports tags : getTagType.

Public Attributes

void(* lastFrameCallback )(void *)
void * callBackData
 The user data to pass in the callback function argument.


Detailed Description

This class interfaces WSOLA and Audiere. By interfacing WSOLA and Audiere, time scale modificaiton of audio (speeding and slowing of audio in real time) is accomplished. Audiere is responsible for file reading and decomression as well as sound card device operation. WSOLA is responsible for the time scale modification in real time.

To use this class one must : //Start Audiere as normal ...

//Construct a WSOLA based sound source... WSOLA4Audiere mWsolaSource = new WSOLA4Audiere(mSampleSource, mTau, mFrameStartIndex, mFrameEndIndex);

//create a stream using WSOLA4Audiere as the source OutputStreamPtr mOutputStream(OpenSound(mAudioDevice, mWsolaSource , true)); //play the stream to hear it. mOutputStream->play();

//You may now alter the speed of audio playback in real time ... mWsolaSource->setTau(float tau); //Where float is the speed of playback where : fast < tau=1.0 < slow

Upon finishing, the callback function is executed so WSOLA4Audiere can signal the parent application that the stream has finished playing.


Constructor & Destructor Documentation

audiere::WSOLA4Audiere::WSOLA4Audiere SampleSourcePtr  source,
double  ta = DEF_TAU,
int  startPoint = 0,
int  endPoint = 0,
void(*)(void *)  lastFrameCallback_in = NULL,
void *  callBackData_in = NULL
[inline]
 

The constructor allows one to pass the audiere file (source) and specify the initial speed (ta) as well as the start point (startPoint) and end point (endPoint). The callback function is operational in non WIN32 environments, where it is called upon hitting the last frame lastFrameCallback_in(callBackData_in);


Member Data Documentation

void(* audiere::WSOLA4Audiere::lastFrameCallback)(void *)
 

A callback function which notifies a parent app. that the last frame is being processed. This function is passed some user data (if necessary)


The documentation for this class was generated from the following file:
Generated on Thu Apr 21 00:33:47 2005 by  doxygen 1.4.2