mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-27 05:26:13 +01:00
Added stereo recording support to sfSoundRecorder.
This commit is contained in:
1 parent
15995fa19c
commit
3c70f99028
2 files changed
+45
No files matched your search
@@ -185,5 +185,33 @@ CSFML_AUDIO_API sfBool sfSoundRecorder_setDevice(sfSoundRecorder* soundRecorder,
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API const char* sfSoundRecorder_getDevice(sfSoundRecorder* soundRecorder);
|
CSFML_AUDIO_API const char* sfSoundRecorder_getDevice(sfSoundRecorder* soundRecorder);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Set the channel count of the audio capture device
|
||||||
|
///
|
||||||
|
/// This method allows you to specify the number of channels
|
||||||
|
/// used for recording. Currently only 16-bit mono and
|
||||||
|
/// 16-bit stereo are supported.
|
||||||
|
///
|
||||||
|
/// \param channelCount Number of channels. Currently only
|
||||||
|
/// mono (1) and stereo (2) are supported.
|
||||||
|
///
|
||||||
|
/// \see sfSoundRecorder_getChannelCount
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_AUDIO_API void sfSoundRecorder_setChannelCount(sfSoundRecorder* soundRecorder, unsigned int channelCount);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Get the number of channels used by this recorder
|
||||||
|
///
|
||||||
|
/// Currently only mono and stereo are supported, so the
|
||||||
|
/// value is either 1 (for mono) or 2 (for stereo).
|
||||||
|
///
|
||||||
|
/// \return Number of channels
|
||||||
|
///
|
||||||
|
/// \see sfSoundRecorder_setChannelCount
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_AUDIO_API unsigned int sfSoundRecorder_getChannelCount(const sfSoundRecorder* soundRecorder);
|
||||||
|
|
||||||
|
|
||||||
#endif // SFML_SOUNDRECORDER_H
|
#endif // SFML_SOUNDRECORDER_H
|
||||||
@@ -102,6 +102,7 @@ const char** sfSoundRecorder_getAvailableDevices(size_t* count)
|
|||||||
return !cstringDevices.empty() ? &cstringDevices[0] : NULL;
|
return !cstringDevices.empty() ? &cstringDevices[0] : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
const char* sfSoundRecorder_getDefaultDevice()
|
const char* sfSoundRecorder_getDefaultDevice()
|
||||||
{
|
{
|
||||||
@@ -110,12 +111,14 @@ const char* sfSoundRecorder_getDefaultDevice()
|
|||||||
return !defaultDevice.empty() ? defaultDevice.c_str() : NULL;
|
return !defaultDevice.empty() ? defaultDevice.c_str() : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
sfBool sfSoundRecorder_setDevice(sfSoundRecorder* soundRecorder, const char* name)
|
sfBool sfSoundRecorder_setDevice(sfSoundRecorder* soundRecorder, const char* name)
|
||||||
{
|
{
|
||||||
CSFML_CALL_RETURN(soundRecorder, setDevice(name), sfFalse);
|
CSFML_CALL_RETURN(soundRecorder, setDevice(name), sfFalse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
const char* sfSoundRecorder_getDevice(sfSoundRecorder* soundRecorder)
|
const char* sfSoundRecorder_getDevice(sfSoundRecorder* soundRecorder)
|
||||||
{
|
{
|
||||||
@@ -125,3 +128,17 @@ const char* sfSoundRecorder_getDevice(sfSoundRecorder* soundRecorder)
|
|||||||
|
|
||||||
return soundRecorder->DeviceName.c_str();
|
return soundRecorder->DeviceName.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
void sfSoundRecorder_setChannelCount(sfSoundRecorder* soundRecorder, unsigned int channelCount)
|
||||||
|
{
|
||||||
|
CSFML_CALL(soundRecorder, setChannelCount(channelCount));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
unsigned int sfSoundRecorder_getChannelCount(const sfSoundRecorder* soundRecorder)
|
||||||
|
{
|
||||||
|
CSFML_CALL_RETURN(soundRecorder, getChannelCount(), 0);
|
||||||
|
}
|
||||||
Reference in new issue
Block a user