Panda3D
|
A UserDataAudio is a way for the user to manually supply raw audio samples. More...
#include "userDataAudio.h"
Public Member Functions | |
UserDataAudio (int rate, int channels, bool remove_after_read=true) | |
This constructor returns a UserDataAudio --- a means to supply raw audio samples manually. | |
void | append (PN_int16 *data, int n) |
Appends audio samples to the buffer. | |
void | append (DatagramIterator *src, int len=0x40000000) |
Appends audio samples to the buffer from a datagram. | |
void | append (const string &str) |
Appends audio samples to the buffer from a string. | |
void | done () |
Promises not to append any more samples, ie, this marks the end of the audio stream. | |
virtual TypeHandle | force_init_type () |
virtual TypeHandle | get_type () const |
virtual | PT (MovieAudioCursor) open() |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
Friends | |
class | UserDataAudioCursor |
A UserDataAudio is a way for the user to manually supply raw audio samples.
remove_after_read means the data will be removed if read once. Else data will be stored (enable looping and seeking). Expects data as 16 bit signed (word); Example for stereo: 1.word = 1.channel,2.word = 2.channel, 3.word = 1.channel,4.word = 2.channel, etc.
Definition at line 35 of file userDataAudio.h.
UserDataAudio::UserDataAudio | ( | int | rate, |
int | channels, | ||
bool | remove_after_read = true |
||
) |
This constructor returns a UserDataAudio --- a means to supply raw audio samples manually.
Definition at line 27 of file userDataAudio.cxx.
void UserDataAudio::append | ( | PN_int16 * | data, |
int | n | ||
) |
Appends audio samples to the buffer.
Definition at line 94 of file userDataAudio.cxx.
void UserDataAudio::append | ( | DatagramIterator * | src, |
int | n = 0x40000000 |
||
) |
Appends audio samples to the buffer from a datagram.
This is intended to make it easy to send streaming raw audio over a network.
Definition at line 110 of file userDataAudio.cxx.
References DatagramIterator::get_int16(), and DatagramIterator::get_remaining_size().
void UserDataAudio::append | ( | const string & | str | ) |
Appends audio samples to the buffer from a string.
The samples must be stored little-endian in the string. This is not particularly efficient, but it may be convenient to deal with samples in python.
Definition at line 130 of file userDataAudio.cxx.
void UserDataAudio::done | ( | ) |
Promises not to append any more samples, ie, this marks the end of the audio stream.
Definition at line 149 of file userDataAudio.cxx.