#include <SFML/Config.h>#include <SFML/Audio/SoundStatus.h>#include <SFML/Audio/Types.h>Go to the source code of this file.
Functions | |
| CSFML_API sfSound * | sfSound_Create () |
| Construct a new sound. | |
| CSFML_API void | sfSound_Destroy (sfSound *Sound) |
| Destroy an existing sound. | |
| CSFML_API void | sfSound_Play (sfSound *Sound) |
| Start playing a sound. | |
| CSFML_API void | sfSound_Pause (sfSound *Sound) |
| Pause a sound. | |
| CSFML_API void | sfSound_Stop (sfSound *Sound) |
| Stop playing a sound. | |
| CSFML_API void | sfSound_SetBuffer (sfSound *Sound, sfSoundBuffer *Buffer) |
| Bind a sound buffer to a sound. | |
| CSFML_API sfSoundBuffer * | sfSound_GetBuffer (sfSound *Sound) |
| Get the sound buffer bound to a sound. | |
| CSFML_API void | sfSound_SetLoop (sfSound *Sound, sfBool Loop) |
| Set a sound loop state. | |
| CSFML_API sfBool | sfSound_GetLoop (sfSound *Sound) |
| Tell whether or not a sound is looping. | |
| CSFML_API sfSoundStatus | sfSound_GetStatus (sfSound *Sound) |
| Get the status of a sound (stopped, paused, playing). | |
| CSFML_API void | sfSound_SetPitch (sfSound *Sound, float Pitch) |
| Set the pitch of a sound. | |
| CSFML_API void | sfSound_SetVolume (sfSound *Sound, float Volume) |
| Set the volume of a sound. | |
| CSFML_API void | sfSound_SetPosition (sfSound *Sound, float X, float Y, float Z) |
| Set the position of a sound. | |
| CSFML_API void | sfSound_SetRelativeToListener (sfSound *Sound, sfBool Relative) |
| Make the sound's position relative to the listener's position, or absolute. | |
| CSFML_API void | sfSound_SetMinDistance (sfSound *Sound, float MinDistance) |
| Set the minimum distance - closer than this distance, the listener will hear the sound at its maximum volume. | |
| CSFML_API void | sfSound_SetAttenuation (sfSound *Sound, float Attenuation) |
| Set the attenuation factor - the higher the attenuation, the more the sound will be attenuated with distance from listener. | |
| CSFML_API void | sfSound_SetPlayingOffset (sfSound *Sound, float TimeOffset) |
| Set the current playing position of a sound. | |
| CSFML_API float | sfSound_GetPitch (sfSound *Sound) |
| Get the pitch of a sound. | |
| CSFML_API float | sfSound_GetVolume (sfSound *Sound) |
| Get the volume of a sound. | |
| CSFML_API void | sfSound_GetPosition (sfSound *Sound, float *X, float *Y, float *Z) |
| Get the position of a sound. | |
| CSFML_API sfBool | sfSound_IsRelativeToListener (sfSound *Sound) |
| Tell if the sound's position is relative to the listener's position, or if it's absolute. | |
| CSFML_API float | sfSound_GetMinDistance (sfSound *Sound) |
| Get the minimum distance of a sound. | |
| CSFML_API float | sfSound_GetAttenuation (sfSound *Sound) |
| Get the attenuation factor of a sound. | |
| CSFML_API float | sfSound_GetPlayingOffset (sfSound *Sound) |
| Get the current playing position of a sound. | |
| CSFML_API sfSound* sfSound_Create | ( | ) |
Construct a new sound.
| CSFML_API void sfSound_Destroy | ( | sfSound * | Sound | ) |
Destroy an existing sound.
| Sound | : Sound to delete |
| CSFML_API float sfSound_GetAttenuation | ( | sfSound * | Sound | ) |
Get the attenuation factor of a sound.
| Sound | : Sound to get the attenuation factor from |
| CSFML_API sfSoundBuffer* sfSound_GetBuffer | ( | sfSound * | Sound | ) |
Get the sound buffer bound to a sound.
| Sound | : Sound to get the buffer from |
Tell whether or not a sound is looping.
| Sound | : Sound to get the loop state from |
| CSFML_API float sfSound_GetMinDistance | ( | sfSound * | Sound | ) |
Get the minimum distance of a sound.
| Sound | : Sound to get the minimum distance from |
| CSFML_API float sfSound_GetPitch | ( | sfSound * | Sound | ) |
Get the pitch of a sound.
| Sound | : Sound to get the pitch from |
| CSFML_API float sfSound_GetPlayingOffset | ( | sfSound * | Sound | ) |
Get the current playing position of a sound.
| Sound | : Sound to get the position from |
| CSFML_API void sfSound_GetPosition | ( | sfSound * | Sound, | |
| float * | X, | |||
| float * | Y, | |||
| float * | Z | |||
| ) |
Get the position of a sound.
| Sound | : Sound to get the position from | |
| X | : X position of the sound in the world | |
| Y | : Y position of the sound in the world | |
| Z | : Z position of the sound in the world |
| CSFML_API sfSoundStatus sfSound_GetStatus | ( | sfSound * | Sound | ) |
Get the status of a sound (stopped, paused, playing).
| Sound | : Sound to get the status from |
| CSFML_API float sfSound_GetVolume | ( | sfSound * | Sound | ) |
Get the volume of a sound.
| Sound | : Sound to get the volume from |
Tell if the sound's position is relative to the listener's position, or if it's absolute.
| Sound | : Sound to check |
| CSFML_API void sfSound_Pause | ( | sfSound * | Sound | ) |
Pause a sound.
| Sound | : Sound to pause |
| CSFML_API void sfSound_Play | ( | sfSound * | Sound | ) |
Start playing a sound.
| Sound | : Sound to play |
| CSFML_API void sfSound_SetAttenuation | ( | sfSound * | Sound, | |
| float | Attenuation | |||
| ) |
Set the attenuation factor - the higher the attenuation, the more the sound will be attenuated with distance from listener.
The default attenuation factor is 1.0
| Sound | : Sound to modify | |
| Attenuation | : New attenuation factor for the sound |
| CSFML_API void sfSound_SetBuffer | ( | sfSound * | Sound, | |
| sfSoundBuffer * | Buffer | |||
| ) |
Bind a sound buffer to a sound.
| Sound | : Sound to set the loop state | |
| Buffer | : Buffer to bind |
Set a sound loop state.
| Sound | : Sound to set the loop state | |
| Loop | : sfTrue to play in loop, sfFalse to play once |
| CSFML_API void sfSound_SetMinDistance | ( | sfSound * | Sound, | |
| float | 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
| Sound | : Sound to modify | |
| MinDistance | : New minimum distance for the sound |
| CSFML_API void sfSound_SetPitch | ( | sfSound * | Sound, | |
| float | Pitch | |||
| ) |
Set the pitch of a sound.
| Sound | : Sound to modify | |
| Pitch | : New pitch |
| CSFML_API void sfSound_SetPlayingOffset | ( | sfSound * | Sound, | |
| float | TimeOffset | |||
| ) |
Set the current playing position of a sound.
| Sound | : Sound to modify | |
| TimeOffset | : New playing position, expressed in seconds |
| CSFML_API void sfSound_SetPosition | ( | sfSound * | Sound, | |
| float | X, | |||
| float | Y, | |||
| float | Z | |||
| ) |
Set the position of a sound.
| Sound | : Sound to modify | |
| X | : X position of the sound in the world | |
| Y | : Y position of the sound in the world | |
| Z | : Z position of the sound in the world |
Make the sound's position relative to the listener's position, or absolute.
The default value is false (absolute)
| Sound | : Sound to modify | |
| Relative | : True to set the position relative, false to set it absolute |
| CSFML_API void sfSound_SetVolume | ( | sfSound * | Sound, | |
| float | Volume | |||
| ) |
Set the volume of a sound.
| Sound | : Sound to modify | |
| Volume | : Volume (in range [0, 100]) |
| CSFML_API void sfSound_Stop | ( | sfSound * | Sound | ) |
Stop playing a sound.
| Sound | : Sound to stop |