Loading...
Searching...
No Matches
Sound.h
Go to the documentation of this file.
1
2//
3// SFML - Simple and Fast Multimedia Library
4// Copyright (C) 2007-2024 Laurent Gomila (laurent@sfml-dev.org)
5//
6// This software is provided 'as-is', without any express or implied warranty.
7// In no event will the authors be held liable for any damages arising from the use of this software.
8//
9// Permission is granted to anyone to use this software for any purpose,
10// including commercial applications, and to alter it and redistribute it freely,
11// subject to the following restrictions:
12//
13// 1. The origin of this software must not be misrepresented;
14// you must not claim that you wrote the original software.
15// If you use this software in a product, an acknowledgment
16// in the product documentation would be appreciated but is not required.
17//
18// 2. Altered source versions must be plainly marked as such,
19// and must not be misrepresented as being the original software.
20//
21// 3. This notice may not be removed or altered from any source distribution.
22//
24
25#pragma once
26
28// Headers
30#include <CSFML/Audio/Export.h>
31
35#include <CSFML/Audio/Types.h>
36#include <CSFML/System/Time.h>
38
39
49
59
67
81
92
104
117
127
141
151
161
175CSFML_AUDIO_API void sfSound_setPitch(sfSound* sound, float pitch);
176
189CSFML_AUDIO_API void sfSound_setPan(sfSound* sound, float pan);
190
191
202CSFML_AUDIO_API void sfSound_setVolume(sfSound* sound, float volume);
203
217
230
244
256
270
282
298
313
328CSFML_AUDIO_API void sfSound_setMinDistance(sfSound* sound, float distance);
329
344CSFML_AUDIO_API void sfSound_setMaxDistance(sfSound* sound, float distance);
345
358
372
389CSFML_AUDIO_API void sfSound_setAttenuation(sfSound* sound, float attenuation);
390
402
414
424
434
444
454
464
474
484
494
504
514
525
535
545
555
565
575
#define CSFML_AUDIO_API
struct sfSoundBuffer sfSoundBuffer
Definition Audio/Types.h:29
struct sfSound sfSound
Definition Audio/Types.h:28
void(* sfEffectProcessor)(const float *inputFrames, unsigned int *inputFrameCount, float *outputFrames, unsigned int *outputFrameCount, unsigned int frameChannelCount)
Callable that is provided with sound data for processing.
sfSoundStatus
Enumeration of statuses for sounds and musics.
Definition SoundStatus.h:38
float sfSound_getMaxGain(const sfSound *sound)
Get the maximum gain of the sound.
void sfSound_setPan(sfSound *sound, float pan)
Set the pan of the sound.
bool sfSound_isRelativeToListener(const sfSound *sound)
Tell whether a sound's position is relative to the listener or is absolute.
void sfSound_setCone(sfSound *sound, sfSoundSourceCone cone)
Set the cone properties of the sound in the audio scene.
void sfSound_setSpatializationEnabled(sfSound *sound, bool enabled)
Set whether spatialization of the sound is enabled.
float sfSound_getPitch(const sfSound *sound)
Get the pitch of a sound.
void sfSound_pause(sfSound *sound)
Pause a sound.
void sfSound_setDirection(sfSound *sound, sfVector3f direction)
Set the 3D direction of the sound in the audio scene.
void sfSound_setPosition(sfSound *sound, sfVector3f position)
Set the 3D position of a sound in the audio scene.
sfSound * sfSound_copy(const sfSound *sound)
Create a new sound by copying an existing one.
sfSoundSourceCone sfSound_getCone(const sfSound *sound)
Get the cone properties of the sound in the audio scene.
void sfSound_setVolume(sfSound *sound, float volume)
Set the volume of a sound.
void sfSound_setRelativeToListener(sfSound *sound, bool relative)
Make the sound's position relative to the listener or absolute.
void sfSound_setMaxGain(sfSound *sound, float gain)
Set the maximum gain of the sound.
void sfSound_stop(sfSound *sound)
Stop playing a sound.
sfSound * sfSound_create(const sfSoundBuffer *buffer)
Create a new sound.
bool sfSound_isSpatializationEnabled(const sfSound *sound)
Tell whether spatialization of the sound is enabled.
void sfSound_destroy(const sfSound *sound)
Destroy a sound.
void sfSound_play(sfSound *sound)
Start or resume playing a sound.
void sfSound_setAttenuation(sfSound *sound, float attenuation)
Set the attenuation factor of a sound.
void sfSound_setPitch(sfSound *sound, float pitch)
Set the pitch of a sound.
void sfSound_setMinGain(sfSound *sound, float gain)
Set the minimum gain of the sound.
float sfSound_getMaxDistance(const sfSound *sound)
Get the maximum distance of the sound.
float sfSound_getPan(const sfSound *sound)
Get the pan of the sound.
void sfSound_setVelocity(sfSound *sound, sfVector3f velocity)
Set the 3D velocity of the sound in the audio scene.
float sfSound_getMinDistance(const sfSound *sound)
Get the minimum distance of a sound.
float sfSound_getVolume(const sfSound *sound)
Get the volume of a sound.
void sfSound_setDopplerFactor(sfSound *sound, float factor)
Set the doppler factor of the sound.
sfTime sfSound_getPlayingOffset(const sfSound *sound)
Get the current playing position of a sound.
void sfSound_setBuffer(sfSound *sound, const sfSoundBuffer *buffer)
Set the source buffer containing the audio data to play.
sfVector3f sfSound_getVelocity(const sfSound *sound)
Get the 3D velocity of the sound in the audio scene.
float sfSound_getDopplerFactor(const sfSound *sound)
Get the doppler factor of the sound.
void sfSound_setEffectProcessor(sfSound *sound, sfEffectProcessor effectProcessor)
Set the effect processor to be applied to the sound.
void sfSound_setPlayingOffset(sfSound *sound, sfTime timeOffset)
Change the current playing position of a sound.
void sfSound_setMinDistance(sfSound *sound, float distance)
Set the minimum distance of a sound.
sfVector3f sfSound_getPosition(const sfSound *sound)
Get the 3D position of a sound in the audio scene.
float sfSound_getAttenuation(const sfSound *sound)
Get the attenuation factor of a sound.
const sfSoundBuffer * sfSound_getBuffer(const sfSound *sound)
Get the audio buffer attached to a sound.
sfSoundStatus sfSound_getStatus(const sfSound *sound)
Get the current status of a sound (stopped, paused, playing)
void sfSound_setMaxDistance(sfSound *sound, float distance)
Set the maximum distance of the sound.
void sfSound_setLooping(sfSound *sound, bool loop)
Set whether or not a sound should loop after reaching the end.
float sfSound_getDirectionalAttenuationFactor(const sfSound *sound)
Get the directional attenuation factor of the sound.
bool sfSound_isLooping(const sfSound *sound)
Tell whether or not a sound is in loop mode.
sfVector3f sfSound_getDirection(const sfSound *sound)
Get the 3D direction of the sound in the audio scene.
void sfSound_setDirectionalAttenuationFactor(sfSound *sound, float factor)
Set the directional attenuation factor of the sound.
float sfSound_getMinGain(const sfSound *sound)
Get the minimum gain of the sound.
Structure defining the properties of a directional cone.
Represents a time value.
Definition Time.h:38
3-component vector of floats
Definition Vector3.h:38