sf.Music Class Reference

sf.Music defines a big sound played using streaming, so usually what we call a music :).
Constructor: sf.Music(BufferSize=44100)
BufferSize : Size of the internal buffer, expressed in number of samples (ie. size taken by the music in memory) (44100 by default)
Base class: sf.SoundStream.

Attributes

Paused
Playing
Stopped

Methods

GetAttenuation()
Get the attenuation factor.
Inherited
GetChannelsCount()
Return the number of channels (1 = mono, 2 = stereo).
Inherited
GetDuration()
Get the sound duration.
GetLoop()
Tell whether or not the music is looping.
Inherited
GetMinDistance()
Get the minimum distance.
Inherited
GetPitch()
Get the sound pitch.
Inherited
GetPlayingOffset()
Get the current playing position of the stream.
Inherited
GetPosition()
Get the sound position in the world. Returns a tuple.
Inherited
GetSampleRate()
Get the sound frequency (sample rate).
Inherited
GetStatus()
Get the status of the sound (stopped, paused, playing).
Inherited
GetVolume()
Get the sound volume.
Inherited
Initialize(ChannelsCount, SampleRate)
Set the audio stream parameters, you must call it before Play()
    ChannelsCount : Number of channels
    SampleRate : Sample rate.
Inherited
IsRelativeToListener()
Tell if the sound's position is relative to the listener's position, or if it's absolute.
Inherited
OpenFromFile(Filename)
Open a music file (doesn't play it -- call Play() for that). Returns True if loading has been successful.
    Filename : Path of the music file to open
OpenFromMemory(Data)
Open a music file (doesn't play it -- call Play() for that). Returns True if loading has been successful.
    Data : string representing the file data in memory
Pause()
Pause the sound.
Inherited
Play()
Play the sound.
Inherited
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
Inherited
SetLoop(Loop)
Set the music loop state. This parameter is disabled by default
    Loop : True to play in loop, false to play once
Inherited
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
Inherited
SetPitch(Pitch)
Set the sound pitch. The default pitch is 1.
    Pitch : New pitch
Inherited
SetPosition(X, Y, Z)
Set the sound position in the world.
    X,Y,Z : Position of the sound in the world
Inherited
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
Inherited
SetVolume(Volume)
Set the sound volume.
    Volume : Volume (in range [0, 100])
Inherited
Stop()
Stop the sound.
Inherited