Go to the documentation of this file.
58 int desired = n * _audio_channels;
59 for (
int i=0; i<desired; i++) {
76 int blocksize = (4096 / _audio_channels);
77 if (blocksize > n) blocksize = n;
78 int words = blocksize * _audio_channels;
80 for (
int i=0; i<words; i++) {
97 std::ostringstream result;
100 int blocksize = (4096 / _audio_channels);
101 if (blocksize > n) blocksize = n;
102 int words = blocksize * _audio_channels;
104 for (
int i=0; i<words; i++) {
105 int16_t word = tmp[i];
106 result.put((
char)(word & 255));
107 result.put((
char)((word>>8) & 255));
MovieAudioCursor(MovieAudio *src)
This constructor returns a null audio stream — a stream of total silence, at 8000 samples per second.
virtual void seek(double offset)
Skips to the specified offset within the file.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
TypeHandle is the identifier used to differentiate C++ class types.
virtual int ready() const
Returns the number of audio samples that are ready to read.
void add_int16(int16_t value)
Adds a signed 16-bit integer to the datagram.
void read_samples(int n, Datagram *dg)
Read audio samples from the stream into a Datagram.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A MovieAudio is actually any source that provides a sequence of audio samples.