sf.SoundStream Class Reference
SoundStream is a streamed sound, ie samples are acquiredwhile the sound is playing. Use it for big sounds that wouldrequire hundreds of MB in memory (see Music),or for streaming sound from the network
Attributes
Paused
Playing
Stopped
Methods
GetAttenuation()
Get the attenuation factor.
GetChannelsCount()
Return the number of channels (1 = mono, 2 = stereo).
GetLoop()
Tell whether or not the music is looping.
GetMinDistance()
Get the minimum distance.
GetPitch()
Get the sound pitch.
GetPlayingOffset()
Get the current playing position of the stream.
GetPosition()
Get the sound position in the world. Returns a tuple.
GetSampleRate()
Get the sound frequency (sample rate).
GetStatus()
Get the status of the sound (stopped, paused, playing).
GetVolume()
Get the sound volume.
Initialize(ChannelsCount, SampleRate)
Set the audio stream parameters, you must call it before Play()
ChannelsCount : Number of channels
SampleRate : Sample rate.
IsRelativeToListener()
Tell if the sound's position is relative to the listener's position, or if it's absolute.
Pause()
Pause the sound.
Play()
Play the sound.
SetAttenuation(Attenuation)
Set the attenuation factor - the higher the attenuation, the more the sound will be attenuated with distance from listener. The default attenuation factor 1.0.
Attenuation : New attenuation factor for the sound
SetLoop(Loop)
Set the music loop state. This parameter is disabled by default
Loop : True to play in loop, false to play once
SetMinDistance(MinDistance)
Set the minimum distance - closer than this distance, the listener will hear the sound at its maximum volume. The default minimum distance is 1.0.
MinDistance : New minimum distance for the sound
SetPitch(Pitch)
Set the sound pitch. The default pitch is 1.
Pitch : New pitch
SetPosition(X, Y, Z)
Set the sound position in the world.
X,Y,Z : Position of the sound in the world
SetRelativeToListener(Relative)
Make the sound's position relative to the listener's position, or absolute. The default value is false (absolute)
Relative : True to set the position relative, false to set it absolute
SetVolume(Volume)
Set the sound volume.
Volume : Volume (in range [0, 100])
Stop()
Stop the sound.