Functions
audio.c File Reference
#include "libfreenect.h"
#include "libfreenect_audio.h"
#include "freenect_internal.h"
#include <string.h>
#include <stdlib.h>
Include dependency graph for audio.c:

Go to the source code of this file.

Functions

void freenect_set_audio_in_callback (freenect_device *dev, freenect_audio_in_cb callback)
 
void freenect_set_audio_out_callback (freenect_device *dev, freenect_audio_out_cb callback)
 
int freenect_start_audio (freenect_device *dev)
 
int freenect_stop_audio (freenect_device *dev)
 
static void iso_in_callback (freenect_device *dev, uint8_t *pkt, int len)
 
static void iso_out_callback (freenect_device *dev, uint8_t *pkt, int len)
 
static void prepare_iso_out_data (freenect_device *dev, uint8_t *buffer)
 

Function Documentation

void freenect_set_audio_in_callback ( freenect_device dev,
freenect_audio_in_cb  callback 
)

Set the audio in callback. This is the function called when the library has new microphone samples. It will be called approximately 62.5 times per second (16kHz sample rate, expect 512 samples/callback)

Parameters
devDevice for which to set the callback
callbackCallback function to set

Definition at line 142 of file audio.c.

void freenect_set_audio_out_callback ( freenect_device dev,
freenect_audio_out_cb  callback 
)

Set the audio out callback. This is the "tell me what audio you're about to play through the speakers so the Kinect can subtract it out" callback for a given device. If you choose not set an audio_out_callback, the library will send silence to the Kinect for you - it requires data either way.

Parameters
devDevice for which to set the callback
callbackCallback function to set

Definition at line 145 of file audio.c.

int freenect_start_audio ( freenect_device dev)

Start streaming audio for the specified device.

Parameters
devDevice for which to start audio streaming
Returns
0 on success, < 0 if error

Definition at line 149 of file audio.c.

int freenect_stop_audio ( freenect_device dev)

Stop streaming audio for the specified device.

Parameters
devDevice for which to stop audio streaming
Returns
0 on success, < 0 if error

Definition at line 198 of file audio.c.

static void iso_in_callback ( freenect_device dev,
uint8_t pkt,
int  len 
)
static

Definition at line 85 of file audio.c.

static void iso_out_callback ( freenect_device dev,
uint8_t pkt,
int  len 
)
static

Definition at line 81 of file audio.c.

static void prepare_iso_out_data ( freenect_device dev,
uint8_t buffer 
)
static

Definition at line 34 of file audio.c.



libfreenect
Author(s): Hector Martin, Josh Blake, Kyle Machulis, OpenKinect community
autogenerated on Mon Jun 10 2019 13:46:43