Plays sample or stream audio data. A source will maintain some of its settings (e.g. position in 3D space, reverberation params) across playback of different sources and streams. Some of the source settings will be overridden (i.e. frequency, volume, loop mode) when a new sample or stream is assigned to the source.
Create a new Source object.
Return the currently registered callback function.
Return the currently registered callback function.
Return the currently registered callback function.
Return if the source is currently paused or not.
Return if the source is currently in the midst of playing a sound or not. A source that is paused is still considered playing.
Pause a currently playing sound.
Play a currently stopped sound from the beginning. Resume a paused sound.
Registers a function to be called when this source finishes playing a stream. The callback function must follow this prototype:
OnEndStream(Source)
where the object passed to the function is the source that was playing the stream.
Registers a function to be called when this source receives metadata while playing an Internet stream. The callback function must follow this prototype:
OnMetadataStream(Source, string, string)
where the first parameter is the source that was playing the stream, the second is the name of the metadatum, and third is the value of the metadatum.
Registers a function to be called when this source encounters a synchronization point while playing a stream. The callback function must follow this prototype:
OnSyncStream(Source, string)
where the first parameter is the source that was playing the stream and the second is the name of the sync point encountered.
Stop a currently playing or paused sound.
The amplitude of the playing sound based on its volume, its 3D position, and the master volume. Values range between 0 and 255.
The left and right levels of the playing sound. Only registers for sounds mixed in software. Values range between 0 and 255.
The current position in samples of the playing sound.
The current position in seconds of the playing sound. Only works with streams. Playing samples always return zero.
The frequency used to playback the current sound. This value is overridden the next time a new sound is assigned to this source.
The loop mode used to playback the current sound. The value can be set to any of the pySonic.Constants.FSOUND_LOOP_* flags. This value is overridden the next time a new sound is assigned to this source.
The position of the source in 3D space. Only affects 3D sounds.
The priority of the source indicating how easily it can be preempted when channels are limited. Values range between 0 and 255. A value of 256 is reserved for sources playing streams.
The flag indicating if a source reserves a channel and cannot be pre-empted by another source.
The Sound object assigned to this source for playback. See the Sound class for details on creating or loading sounds.
The flag indicating whether or not the source will use a hack to make sound playback sound fuller or spacier on two speaker systems.
The velocity of the source in 3D space. Only works with mono sounds.
The volume used to playback the current sound. Values range from 0 to 255. This value is overridden the next time a new sound is assigned to this source.