AudioSound
from panda3d.core import AudioSound
- class AudioSound
Bases:
Bases:
TypedReferenceCountInheritance diagram
- property balance float
-1.0 is hard left 0.0 is centered 1.0 is hard right inits to 0.0.
-1.0 is hard left 0.0 is centered 1.0 is hard right inits to 0.0.
- configure_filters(config: FilterProperties) bool
- static get_class_type() TypeHandle
- get_raw_comment() vector_string
- make_copy() AudioSound
Construct a near-identical copy of this object on the heap and return a pointer to the new copy. Currently only implemented for OpenAL.
- property name string
There is no set_name(), this is intentional.
There is no set_name(), this is intentional.
There is no set_name(), this is intentional.
- play()
For best compatibility, set the loop_count, volume, and balance, prior to calling play(). You may set them while they’re playing, but it’s implementation specific whether you get the results. - Calling play() a second time on the same sound before it is finished will start the sound again (creating a skipping or stuttering effect).
- property play_rate float
play_rate is any positive PN_stdfloat value. inits to 1.0.
play_rate is any positive PN_stdfloat value. inits to 1.0.
- set_3d_attributes(px: float, py: float, pz: float, vx: float, vy: float, vz: float)
Controls the position of this sound’s emitter. px, py and pz are the emitter’s position. vx, vy and vz are the emitter’s velocity in UNITS PER SECOND (default: meters).
- set_3d_cone_inner_angle(angle: float)
Sets the angle of the inner cone of a directional sound source. In the zone inside of the inner cone sound is emitted with the (normal) volume set by
set_volume().
- set_3d_cone_outer_angle(angle: float)
Sets the angle of the outer cone of a directional sound source. In the zone between the inner and the outer cone the volume is attenuated.
- set_3d_cone_outer_gain(gain: float)
Sets a factor applied to the volume set by
set_volume()for the zone outside the outer cone. By default this is 0 (so no sound is heard inside the outer zone).
- set_3d_direction(d: LVector3)
Controls the direction of this sound emitter. Currently implemented only for OpenAL.
- set_3d_max_distance(dist: float)
Controls the maximum distance (in units) that this sound stops falling off. The sound does not stop at that point, it just doesn’t get any quieter. You should rarely need to adjust this. Default is 1000000000.0
- set_3d_min_distance(dist: float)
Controls the distance (in units) that this sound begins to fall off. Also affects the rate it falls off. Default is 1.0 CloserFaster, <1.0 FartherSlower, >1.0
- set_balance(balance_right: float)
-1.0 is hard left 0.0 is centered 1.0 is hard right inits to 0.0.
- set_finished_event(event: str)
Set (or clear) the event that will be thrown when the sound finishes playing. To clear the event, pass an empty string.
- set_loop_count(loop_count: int)
loop_count: 0 = forever; 1 = play once; n = play n times. inits to 1.
- set_speaker_mix(frontleft: float, frontright: float, center: float, sub: float, backleft: float, backright: float, sideleft: float, sideright: float)
- set_time(start_time: float)
Control time position within the sound, in seconds. This is similar (in concept) to the seek position within a file. The value starts at 0.0 (the default) and ends at the value given by the
length()method.In the past, this call did nothing if the sound was currently playing, and it was necessary to call
play()to effect the change. This is no longer the case; the time change takes effect immediately.If a sound is playing, calling
get_time()repeatedly will return different results over time. e.g.PN_stdfloat percent_complete = s.get_time() / s.length();
- status() SoundStatus
- stop()
- property time float
Control time position within the sound, in seconds. This is similar (in concept) to the seek position within a file. The value starts at 0.0 (the default) and ends at the value given by the
length()method.In the past, this call did nothing if the sound was currently playing, and it was necessary to call
play()to effect the change. This is no longer the case; the time change takes effect immediately.If a sound is playing, calling
get_time()repeatedly will return different results over time. e.g.PN_stdfloat percent_complete = s.get_time() / s.length();
Control time position within the sound, in seconds. This is similar (in concept) to the seek position within a file. The value starts at 0.0 (the default) and ends at the value given by the
length()method.In the past, this call did nothing if the sound was currently playing, and it was necessary to call
play()to effect the change. This is no longer the case; the time change takes effect immediately.If a sound is playing, calling
get_time()repeatedly will return different results over time. e.g.PN_stdfloat percent_complete = s.get_time() / s.length();
