SoundRecorder.h File Reference

#include <SFML/Config.h>
#include <SFML/Audio/SoundBuffer.h>

Go to the source code of this file.


Typedefs

typedef sfSoundRecorder sfSoundRecorder
 sfSoundRecorder is an interface for capturing sound data

Functions

CSFML_API sfSoundRecordersfSoundRecorder_Create (sfBool(*Callback)(const sfInt16 *, size_t, void *), void *UserData)
 Construct a new sound recorder with a callback function for processing captured samples.
CSFML_API void sfSoundRecorder_Destroy (sfSoundRecorder *SoundRecorder)
 Destroy an existing sound recorder.
CSFML_API void sfSoundRecorder_Start (sfSoundRecorder *SoundRecorder, unsigned int SampleRate)
 Start the capture.
CSFML_API void sfSoundRecorder_Stop (sfSoundRecorder *SoundRecorder)
 Stop the capture.
CSFML_API unsigned int sfSoundRecorder_GetSampleRate (sfSoundRecorder *SoundRecorder)
 Get the sample rate of a sound recorder.
CSFML_API sfBool sfSoundRecorder_CanCapture ()
 Tell if the system supports sound capture.

Typedef Documentation

typedef struct sfSoundRecorder sfSoundRecorder

sfSoundRecorder is an interface for capturing sound data

Definition at line 38 of file SoundRecorder.h.


Function Documentation

CSFML_API sfBool sfSoundRecorder_CanCapture (  ) 

Tell if the system supports sound capture.

If not, this class won't be usable

Returns:
sfTrue if audio capture is supported

CSFML_API sfSoundRecorder* sfSoundRecorder_Create ( sfBool(*)(const sfInt16 *, size_t, void *)  Callback,
void *  UserData 
)

Construct a new sound recorder with a callback function for processing captured samples.

Parameters:
Callback : Callback function for processing captured samples
UserData : Data to pass to the callback function (can be NULL)
Returns:
A new sfSoundRecorder object (NULL if failed)

CSFML_API void sfSoundRecorder_Destroy ( sfSoundRecorder SoundRecorder  ) 

Destroy an existing sound recorder.

Parameters:
SoundRecorder : Sound recorder to delete

CSFML_API unsigned int sfSoundRecorder_GetSampleRate ( sfSoundRecorder SoundRecorder  ) 

Get the sample rate of a sound recorder.

Parameters:
SoundRecorder : Sound recorder to get sample rate from
Returns:
Frequency, in samples per second

CSFML_API void sfSoundRecorder_Start ( sfSoundRecorder SoundRecorder,
unsigned int  SampleRate 
)

Start the capture.

Warning : only one capture can happen at the same time

Parameters:
SoundRecorder : Sound recorder to start
SampleRate : Sound frequency (the more samples, the higher the quality)

CSFML_API void sfSoundRecorder_Stop ( sfSoundRecorder SoundRecorder  ) 

Stop the capture.

Parameters:
SoundRecorder : Sound recorder to stop