Panda3D
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Public Member Functions | Static Public Member Functions
UserDataAudio Class Reference

A UserDataAudio is a way for the user to manually supply raw audio samples. More...

Inheritance diagram for UserDataAudio:
MovieAudio TypedWritableReferenceCount Namable TypedWritable ReferenceCount TypedObject

List of all members.

Public Member Functions

 UserDataAudio (int rate, int channels, bool remove_after_read)
 This constructor returns a UserDataAudio --- a means to supply raw audio samples manually.
 UserDataAudio (int rate, int channels)
 This constructor returns a UserDataAudio --- a means to supply raw audio samples manually.
 append (DatagramIterator src, int len)
 Appends audio samples to the buffer from a datagram.
 append (DatagramIterator src)
 Appends audio samples to the buffer from a datagram.
 append (string str)
 Appends audio samples to the buffer from a string.
 done ()
 Promises not to append any more samples, ie, this marks the end of the audio stream.
MovieAudioCursor open ()
 Open this audio, returning a UserDataAudioCursor.

Static Public Member Functions

static TypeHandle getClassType ()

Detailed Description

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.


Constructor & Destructor Documentation

UserDataAudio ( int  rate,
int  channels,
bool  remove_after_read 
)

This constructor returns a UserDataAudio --- a means to supply raw audio samples manually.

UserDataAudio ( int  rate,
int  channels 
)

This constructor returns a UserDataAudio --- a means to supply raw audio samples manually.


Member Function Documentation

append ( DatagramIterator  src,
int  len 
)

Appends audio samples to the buffer from a datagram.

This is intended to make it easy to send streaming raw audio over a network.

Appends audio samples to the buffer from a datagram.

This is intended to make it easy to send streaming raw audio over a network.

append ( 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.

done ( )

Promises not to append any more samples, ie, this marks the end of the audio stream.

static TypeHandle getClassType ( ) [static]

Reimplemented from MovieAudio.

Open this audio, returning a UserDataAudioCursor.

A UserDataAudio can only be opened by one consumer at a time.

Reimplemented from MovieAudio.

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties