aubio 0.4.9
Loading...
Searching...
No Matches
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, const char_t *uri)
 load source in sampler
 
void aubio_sampler_do (aubio_sampler_t *o, const fvec_t *input, fvec_t *output)
 process sampler function
 
void aubio_sampler_do_multi (aubio_sampler_t *o, const fmat_t *input, fmat_t *output)
 process sampler function, multiple channels
 
uint_t aubio_sampler_get_playing (const 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.

Typedef Documentation

◆ aubio_sampler_t

typedef struct _aubio_sampler_t aubio_sampler_t

sampler object

Definition at line 42 of file sampler.h.

Function Documentation

◆ aubio_sampler_do()

void aubio_sampler_do ( aubio_sampler_t * o,
const 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.

◆ aubio_sampler_do_multi()

void aubio_sampler_do_multi ( aubio_sampler_t * o,
const 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.

◆ aubio_sampler_get_playing()

uint_t aubio_sampler_get_playing ( const aubio_sampler_t * o)

get current playing state

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

◆ aubio_sampler_load()

uint_t aubio_sampler_load ( aubio_sampler_t * o,
const 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.

◆ aubio_sampler_play()

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.

◆ aubio_sampler_set_playing()

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

◆ aubio_sampler_stop()

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.

◆ del_aubio_sampler()

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.

◆ new_aubio_sampler()

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.