aubio  0.4.0
 All Data Structures Files Functions Variables Typedefs Macros
Typedefs | Functions
sampler.h File Reference

Load and play sound files. More...

Go to the source code of this file.

Typedefs

typedef struct _aubio_sampler_t aubio_sampler_t
 sampler object
 

Functions

aubio_sampler_tnew_aubio_sampler (uint_t samplerate, uint_t hop_size)
 create new sampler object More...
 
uint_t aubio_sampler_load (aubio_sampler_t *o, char_t *uri)
 load source in sampler More...
 
void aubio_sampler_do (aubio_sampler_t *o, fvec_t *input, fvec_t *output)
 process sampler function More...
 
void aubio_sampler_do_multi (aubio_sampler_t *o, fmat_t *input, fmat_t *output)
 process sampler function, multiple channels More...
 
uint_t aubio_sampler_get_playing (aubio_sampler_t *o)
 get current playing state More...
 
uint_t aubio_sampler_set_playing (aubio_sampler_t *o, uint_t playing)
 set current playing state More...
 
uint_t aubio_sampler_play (aubio_sampler_t *o)
 play sample from start More...
 
uint_t aubio_sampler_stop (aubio_sampler_t *o)
 stop sample More...
 
void del_aubio_sampler (aubio_sampler_t *o)
 destroy aubio_sampler_t object More...
 

Detailed Description

Load and play sound files.

This file loads a sample and gets ready to play it.

The _do function adds the new samples to the input, and write the result as the output.

Definition in file sampler.h.

Function Documentation

void aubio_sampler_do ( aubio_sampler_t o,
fvec_t input,
fvec_t output 
)

process sampler function

Parameters
osampler, created by new_aubio_sampler()
inputinput of the sampler, to be added to the output
outputoutput of the sampler

This function adds the new samples from the playing source to the output.

If input is not NULL and different from output, then the samples from input are added to the output.

Examples:
synth/test-sampler.c.
void aubio_sampler_do_multi ( aubio_sampler_t o,
fmat_t input,
fmat_t output 
)

process sampler function, multiple channels

Parameters
osampler, created by new_aubio_sampler()
inputinput of the sampler, to be added to the output
outputoutput of the sampler

This function adds the new samples from the playing source to the output.

If input is not NULL and different from output, then the samples from input are added to the output.

uint_t aubio_sampler_get_playing ( aubio_sampler_t o)

get current playing state

Parameters
osampler, created by new_aubio_sampler()
Returns
0 if not playing, 1 if playing
uint_t aubio_sampler_load ( aubio_sampler_t o,
char_t uri 
)

load source in sampler

Parameters
osampler, created by new_aubio_sampler()
urithe uri of the source to load
Returns
0 if successful, non-zero otherwise
Examples:
synth/test-sampler.c.
uint_t aubio_sampler_play ( aubio_sampler_t o)

play sample from start

Parameters
osampler, created by new_aubio_sampler()
Returns
0 if successful, 1 otherwise
Examples:
synth/test-sampler.c.
uint_t aubio_sampler_set_playing ( aubio_sampler_t o,
uint_t  playing 
)

set current playing state

Parameters
osampler, created by new_aubio_sampler()
playing0 for not playing, 1 for playing
Returns
0 if successful, 1 otherwise
uint_t aubio_sampler_stop ( aubio_sampler_t o)

stop sample

Parameters
osampler, created by new_aubio_sampler()
Returns
0 if successful, 1 otherwise
Examples:
synth/test-sampler.c.
void del_aubio_sampler ( aubio_sampler_t o)

destroy aubio_sampler_t object

Parameters
osampler, created by new_aubio_sampler()
Examples:
synth/test-sampler.c.
aubio_sampler_t* new_aubio_sampler ( uint_t  samplerate,
uint_t  hop_size 
)

create new sampler object

Parameters
sampleratethe sampling rate of the new sampler
hop_sizethe block size of the new sampler
Returns
the newly created aubio_sampler_t
Examples:
synth/test-sampler.c.