14#ifndef USERDATAAUDIO_H
15#define USERDATAAUDIO_H
34 UserDataAudio(
int rate,
int channels,
bool remove_after_read=
true);
38 void append(int16_t *data,
int n);
40 void append(
const std::string &str);
44 void read_samples(
int n, int16_t *data);
47 int _desired_channels;
48 UserDataAudioCursor *_cursor;
51 bool _remove_after_read;
52 friend class UserDataAudioCursor;
58 static void init_type() {
59 MovieAudio::init_type();
61 MovieAudio::get_class_type());
64 return get_class_type();
66 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
A class to retrieve the individual data elements previously stored in a Datagram.
A MovieAudio is actually any source that provides a sequence of audio samples.
MovieAudio(const std::string &name="Blank Audio")
This constructor returns a null audio stream — a stream of total silence, at 8000 samples per second.
TypeHandle is the identifier used to differentiate C++ class types.
A UserDataAudioCursor is a means to manually supply a sequence of raw audio samples.
void done()
Promises not to append any more samples, ie, this marks the end of the audio stream.
void append(int16_t *data, int n)
Appends audio samples to the buffer.
UserDataAudio(int rate, int channels, bool remove_after_read=true)
This constructor returns a UserDataAudio — a means to supply raw audio samples manually.
This is our own Panda specialization on the default STL deque.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.