CSFML - C binding of the Simple and Fast Multimedia Library

CSFML
SoundBuffer.h
Go to the documentation of this file.
1 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2015 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 #ifndef SFML_SOUNDBUFFER_H
26 #define SFML_SOUNDBUFFER_H
27
29 // Headers
31 #include <SFML/Audio/Export.h>
32 #include <SFML/Audio/Types.h>
33 #include <SFML/System/InputStream.h>
34 #include <SFML/System/Time.h>
35 #include <stddef.h>
36
37
50 CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromFile(const char* filename);
51
65 CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromMemory(const void* data, size_t sizeInBytes);
66
79 CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromStream(sfInputStream* stream);
80
95 CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromSamples(const sfInt16* samples, sfUint64 sampleCount, unsigned int channelCount, unsigned int sampleRate);
96
105 CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_copy(const sfSoundBuffer* soundBuffer);
106
113 CSFML_AUDIO_API void sfSoundBuffer_destroy(sfSoundBuffer* soundBuffer);
114
128 CSFML_AUDIO_API sfBool sfSoundBuffer_saveToFile(const sfSoundBuffer* soundBuffer, const char* filename);
129
142 CSFML_AUDIO_API const sfInt16* sfSoundBuffer_getSamples(const sfSoundBuffer* soundBuffer);
143
155 CSFML_AUDIO_API sfUint64 sfSoundBuffer_getSampleCount(const sfSoundBuffer* soundBuffer);
156
169 CSFML_AUDIO_API unsigned int sfSoundBuffer_getSampleRate(const sfSoundBuffer* soundBuffer);
170
182 CSFML_AUDIO_API unsigned int sfSoundBuffer_getChannelCount(const sfSoundBuffer* soundBuffer);
183
192 CSFML_AUDIO_API sfTime sfSoundBuffer_getDuration(const sfSoundBuffer* soundBuffer);
193
194
195 #endif // SFML_SOUNDBUFFER_H
sfSoundBuffer
struct sfSoundBuffer sfSoundBuffer
Definition: Audio/Types.h:31
Export.h
sfSoundBuffer_destroy
CSFML_AUDIO_API void sfSoundBuffer_destroy(sfSoundBuffer *soundBuffer)
Destroy a sound buffer.
Types.h
sfSoundBuffer_copy
CSFML_AUDIO_API sfSoundBuffer * sfSoundBuffer_copy(const sfSoundBuffer *soundBuffer)
Create a new sound buffer by copying an existing one.
sfUint64
unsigned long long sfUint64
Definition: Config.h:184
sfSoundBuffer_saveToFile
CSFML_AUDIO_API sfBool sfSoundBuffer_saveToFile(const sfSoundBuffer *soundBuffer, const char *filename)
Save a sound buffer to an audio file.
sfInputStream
Set of callbacks that allow users to define custom file streams.
Definition: InputStream.h:44
sfInt16
signed short sfInt16
Definition: Config.h:171
CSFML_AUDIO_API
#define CSFML_AUDIO_API
Definition: Audio/Export.h:43
InputStream.h
sfSoundBuffer_getSampleCount
CSFML_AUDIO_API sfUint64 sfSoundBuffer_getSampleCount(const sfSoundBuffer *soundBuffer)
Get the number of samples stored in a sound buffer.
sfBool
int sfBool
Definition: Config.h:153
sfTime
Represents a time value.
Definition: Time.h:38
sfSoundBuffer_createFromMemory
CSFML_AUDIO_API sfSoundBuffer * sfSoundBuffer_createFromMemory(const void *data, size_t sizeInBytes)
Create a new sound buffer and load it from a file in memory.
sfSoundBuffer_getSamples
CSFML_AUDIO_API const sfInt16 * sfSoundBuffer_getSamples(const sfSoundBuffer *soundBuffer)
Get the array of audio samples stored in a sound buffer.
sfSoundBuffer_getDuration
CSFML_AUDIO_API sfTime sfSoundBuffer_getDuration(const sfSoundBuffer *soundBuffer)
Get the total duration of a sound buffer.
sfSoundBuffer_getSampleRate
CSFML_AUDIO_API unsigned int sfSoundBuffer_getSampleRate(const sfSoundBuffer *soundBuffer)
Get the sample rate of a sound buffer.
sfSoundBuffer_createFromFile
CSFML_AUDIO_API sfSoundBuffer * sfSoundBuffer_createFromFile(const char *filename)
Create a new sound buffer and load it from a file.
sfSoundBuffer_createFromSamples
CSFML_AUDIO_API sfSoundBuffer * sfSoundBuffer_createFromSamples(const sfInt16 *samples, sfUint64 sampleCount, unsigned int channelCount, unsigned int sampleRate)
Create a new sound buffer and load it from an array of samples in memory.
sfSoundBuffer_getChannelCount
CSFML_AUDIO_API unsigned int sfSoundBuffer_getChannelCount(const sfSoundBuffer *soundBuffer)
Get the number of channels used by a sound buffer.
Time.h
sfSoundBuffer_createFromStream
CSFML_AUDIO_API sfSoundBuffer * sfSoundBuffer_createFromStream(sfInputStream *stream)
Create a new sound buffer and load it from a custom stream.