Panda3D
Public Member Functions | Static Public Member Functions | List of all members
UserDataAudioCursor Class Reference

A UserDataAudioCursor is a means to manually supply a sequence of raw audio samples. More...

Inheritance diagram for UserDataAudioCursor:
MovieAudioCursor TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject MemoryBase MemoryBase

Public Member Functions

 __init__ (UserDataAudio src)
 
- Public Member Functions inherited from MovieAudioCursor
 __init__ (MovieAudio src)
 This constructor returns a null audio stream — a stream of total silence, at 8000 samples per second. To get more interesting audio, you need to construct a subclass of this class. More...
 
bool aborted ()
 If aborted is true, it means that the "ready" samples are not being replenished. See the method "ready" for an explanation. More...
 
int audioChannels ()
 Returns the number of audio channels (ie, two for stereo, one for mono). More...
 
int audioRate ()
 Returns the audio sample rate. More...
 
bool canSeek ()
 Returns true if the movie can seek. If this is true, seeking is still not guaranteed to be fast: for some movies, seeking is implemented by rewinding to the beginning and then fast-forwarding to the desired location. Even if the movie cannot seek, the seek method can still advance to an arbitrary location by reading samples and discarding them. However, to move backward, can_seek must return true. More...
 
bool canSeekFast ()
 Returns true if seek operations are constant time. More...
 
MovieAudio getSource ()
 Returns the MovieAudio which this cursor references. More...
 
double length ()
 Returns the length of the movie. Attempting to read audio samples beyond the specified length will produce silent samples. More...
 
str readSamples (int n)
 Read audio samples from the stream and returns them as a string. The samples are stored little-endian in the string. N is the number of samples you wish to read. Multiple-channel audio will be interleaved. More...
 
 readSamples (int n, Datagram dg)
 Read audio samples from the stream into a Datagram. N is the number of samples you wish to read. Multiple-channel audio will be interleaved. More...
 
int ready ()
 Returns the number of audio samples that are ready to read. This is primarily relevant for sources like microphones which produce samples at a fixed rate. If you try to read more samples than are ready, the result will be silent samples. More...
 
 seek (double offset)
 Skips to the specified offset within the file. More...
 
 skipSamples (int n)
 Skip audio samples from the stream. This is mostly for debugging purposes. More...
 
double tell ()
 Returns the current offset within the file. More...
 
- Public Member Functions inherited from TypedWritable
object __reduce__ ()
 
object __reduce_persist__ (object pickler)
 
str encodeToBamStream ()
 Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string. Returns empty string on failure. More...
 
bool encodeToBamStream (String data, BamWriter writer)
 Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string. Returns true on success, false on failure. More...
 
UpdateSeq getBamModified ()
 Returns the current bam_modified counter. This counter is normally incremented automatically whenever the object is modified. More...
 
 markBamModified ()
 Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams. This should normally not need to be called by user code; it should be called internally when the object has been changed in a way that legitimately requires its retransmission to any connected clients. More...
 
- Public Member Functions inherited from TypedObject
TypeHandle getType ()
 Derived classes should override this function to return get_class_type(). More...
 
int getTypeIndex ()
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. This is equivalent to get_type().get_index(). More...
 
bool isExactType (TypeHandle handle)
 Returns true if the current object is the indicated type exactly. More...
 
bool isOfType (TypeHandle handle)
 Returns true if the current object is or derives from the indicated type. More...
 
- Public Member Functions inherited from ReferenceCount
int getRefCount ()
 Returns the current reference count. More...
 
 ref ()
 Explicitly increments the reference count. User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. More...
 
bool testRefCountIntegrity ()
 Does some easy checks to make sure that the reference count isn't completely bogus. Returns true if ok, false otherwise. More...
 
bool testRefCountNonzero ()
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. Returns true if ok, false otherwise. More...
 
bool unref ()
 Explicitly decrements the reference count. Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic.) However, see the helper function unref_delete(). More...
 

Static Public Member Functions

static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from MovieAudioCursor
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedWritableReferenceCount
static TypedWritableReferenceCount decodeFromBamStream (str data, BamReader reader)
 Reads the string created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on that string. Returns NULL on error. More...
 
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedWritable
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedObject
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle getClassType ()
 

Detailed Description

A UserDataAudioCursor is a means to manually supply a sequence of raw audio samples.

Member Function Documentation

◆ __init__()

__init__ ( UserDataAudio  src)

◆ getClassType()

static TypeHandle getClassType ( )
static