#include "libfreenect.h"
#include <stdint.h>
Go to the source code of this file.
Typedef for "you wanted this microphone data, here it is" event callbacks. TODO: Timestamp details The format of the unknown stream is as of yet undetermined.
- Parameters
-
dev | Device which triggered this callback |
num_samples | Number of samples provided in each of the audio data arrays (mic[1-4] and cancelled) |
mic1 | Microphone data for the leftmost microphone: 32-bit PCM little-endian samples at 16kHz. |
mic2 | Microphone data for the left-middle microphone: 32-bit PCM little-endian samples at 16kHz. |
mic3 | Microphone data for the right-middle microphone: 32-bit PCM little-endian samples at 16kHz. |
mic4 | Microphone data for the rightmost microphone: 32-bit PCM little-endian samples at 16kHz. |
cancelled | Noise-cancelled audio data: 16-bit PCM little-endian samples at 16kHz. |
Definition at line 58 of file libfreenect_audio.h.
Typedef for "you're playing audio, the library needs you to fill up the outgoing audio buffer" event callbacks The library will request samples at a rate of 48000Hz.
- Parameters
-
dev | Device this callback was triggered for |
samples | Pointer to the memory where the library expects you to copy the next sample_count freenect_sample_51's to. |
sample_count | Bidirectional. in: maximum number of samples the driver wants (don't copy in more than this, you'll clobber memory). out: actual number of samples provided to the driver. |
Definition at line 71 of file libfreenect_audio.h.
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
-
dev | Device for which to set the callback |
callback | Callback function to set |
Definition at line 142 of file audio.c.
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
-
dev | Device for which to set the callback |
callback | Callback function to set |
Definition at line 145 of file audio.c.
Start streaming audio for the specified device.
- Parameters
-
dev | Device for which to start audio streaming |
- Returns
- 0 on success, < 0 if error
Definition at line 149 of file audio.c.
Stop streaming audio for the specified device.
- Parameters
-
dev | Device for which to stop audio streaming |
- Returns
- 0 on success, < 0 if error
Definition at line 198 of file audio.c.