sfml-audio-0.7.0.1816: minimal bindings to the audio module of sfml

Safe HaskellNone

Sound.SFML

Contents

Synopsis

PolySounds

data PolySound Source

A PolySound allows you to trigger one sound multiple times. The played sounds will then overlap. (Internally, there will be multiple sound instances, that will be triggered one after the other. If there are not enough internal instances, sounds will be cut.)

Instances

newPolySoundSource

Arguments

:: FilePath

soundfile

-> Int

number of internal sound instances.

-> IO PolySound 

Loads a sound into memory.

freePolySound :: PolySound -> IO ()Source

Frees the memory allocated by a sound. Don't use the PolySound afterwards.

triggerPolySound :: PolySound -> Maybe Float -> IO ()Source

Trigger a sound

LoopedSounds

data LoopedSound Source

LoopedSounds are sounds that will always loop. They can just be switched on and off.

Instances

newLoopedSound :: FilePath -> IO LoopedSoundSource

Loads a sound into memory.

freeLoopedSound :: LoopedSound -> IO ()Source

Releases the allocated memory of a LoopedSound. Don't use the LoopedSound afterwards.

startLoopedSound :: Maybe Float -> LoopedSound -> IO ()Source

Starts a looped sound.

stopLoopedSound :: LoopedSound -> IO ()Source

Stops a looped sound.

background music

playMusic :: FilePath -> Maybe Float -> IO ()Source

Loads and plays a music file once in a background thread. Stops other music that is playing. If the current music is Paused and the given file is the same as the one playing, the music is continued. The volume is set again in any case.

playMusicLooped :: FilePath -> Maybe Float -> IO ()Source

Like playMusic, but looping.

stopMusic :: IO ()Source

Stops any background music that is playing.

pauseMusic :: IO ()Source

Pauses the current music.