Trees | Indices | Toggle frames |
---|
Abstract low-level interface for playing audio.
AudioPlayer has no knowledge of sources or eos behaviour. Once created, its audio format cannot be modified. The player will attempt to recover automatically from a buffer underrun (but this is not guaranteed).
Applications should not use this class directly, but instead use Player.
__init__(self,
audio_format)
Create a new audio player for the given audio format.
|
|
int |
get_write_size(self)
Return the maximum number of bytes that can be written.
|
write(self,
audio_data)
Write audio_data to the stream.
|
|
write_eos(self)
Write an EOS marker to the stream at the current write point.
|
|
write_end(self)
Mark that there will be no more audio data past the current write
point.
|
|
play(self)
Begin playback.
|
|
stop(self)
Stop playback.
|
|
clear(self)
Clear all buffered data and prepare for replacement data.
|
|
pump(self)
Called once per loop iteration before checking for eos
triggers.
|
|
float |
get_time(self)
Return best guess of current playback time.
|
bool |
clear_eos(self)
Check if an EOS marker has been passed, and clear it.
|
set_volume(self,
volume)
See Player.volume.
|
|
set_position(self,
position)
See Player.position.
|
|
set_min_distance(self,
min_distance)
See Player.min_distance.
|
|
set_max_distance(self,
max_distance)
See Player.max_distance.
|
|
set_pitch(self,
pitch)
See Player.pitch.
|
|
set_cone_orientation(self, cone_orientation) | |
set_cone_inner_angle(self, cone_inner_angle) | |
set_cone_outer_angle(self, cone_outer_angle) | |
set_cone_outer_gain(self, cone_outer_gain) |
AudioFormat |
audio_format
The player's audio format (read-only).
|
UPDATE_PERIOD = 0.15
|
Return the maximum number of bytes that can be written.
This is used as a hint for preparing data for write, not as a strict contract.
Write audio_data to the stream.
This method calls AudioData.consume to remove data actually written.
Mark that there will be no more audio data past the current write point.
This does not produce an EOS, but is required to prevent data underrun artifacts.
Clear all buffered data and prepare for replacement data.
The player should be stopped before calling this method.
Check if an EOS marker has been passed, and clear it.
This method should be called repeatedly to clear all pending EOS markers.
Trees | Indices | Toggle frames |
---|
Generated by Epydoc 3.0beta1 on Thu Dec 31 17:58:19 2009 | http://epydoc.sourceforge.net |