sfml.audio
Sounds, streaming (musics or custom sources), recording, spatialization.
Attributes
Members list
Type members
Classlikes
Attributes
- Companion
- object
- Supertypes
Regular sound that can be played in the audio environment.
Regular sound that can be played in the audio environment.
Sound is the class to use to play sounds.
It provides:
- Control (play, pause, stop)
- Ability to modify output parameters in real-time (pitch, volume, ...)
- 3D spatial features (position, attenuation, ...).
Sound is perfect for playing short sounds that can fit in memory and require no latency, like foot steps or gun shots. For longer sounds, like background musics or long speeches, rather see Music (which is based on streaming).
In order to work, a sound must be given a buffer of audio data to play. Audio data (samples) is stored in SoundBuffer, and attached to a sound when it is created or with the buffer_= function. The buffer object attached to a sound must remain alive as long as the sound uses it. Note that multiple sounds can use the same sound buffer at the same time.
Usage example:
val buffer = SoundBuffer("sound.wav")
val sound = Sound(buffer)
sound.play()
Attributes
- See also
- Companion
- object
- Supertypes
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
SoundBuffer.type
Base class defining a sound's properties.
Base class defining a sound's properties.
SoundSource is not meant to be used directly, it only serves as a common base for all audio objects that can live in the audio environment.
It defines several properties for the sound: pitch, volume, position, attenuation, etc. All of them can be changed at any time with no impact on performances.
Attributes
- See also
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
SoundSource.type
Attributes
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
SoundStream.type