aubio  0.4.1
Typedefs | Functions
synth/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
uint_t aubio_sampler_load (aubio_sampler_t *o, char_t *uri)
 load source in sampler
void aubio_sampler_do (aubio_sampler_t *o, fvec_t *input, fvec_t *output)
 process sampler function
void aubio_sampler_do_multi (aubio_sampler_t *o, fmat_t *input, fmat_t *output)
 process sampler function, multiple channels
uint_t aubio_sampler_get_playing (aubio_sampler_t *o)
 get current playing state
uint_t aubio_sampler_set_playing (aubio_sampler_t *o, uint_t playing)
 set current playing state
uint_t aubio_sampler_play (aubio_sampler_t *o)
 play sample from start
uint_t aubio_sampler_stop (aubio_sampler_t *o)
 stop sample
void del_aubio_sampler (aubio_sampler_t *o)
 destroy aubio_sampler_t object

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.

get current playing state

Parameters:
osampler, created by new_aubio_sampler()
Returns:
0 if not playing, 1 if playing

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.

play sample from start

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

set current playing state

Parameters:
osampler, created by new_aubio_sampler()
playing0 for not playing, 1 for playing
Returns:
0 if successful, 1 otherwise

stop sample

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

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.
 All Data Structures Files Functions Variables Typedefs Defines