Audio: Rewrite audio module

This commit is contained in:
Jérôme Leclercq
2022-03-17 09:07:52 +01:00
parent eb4629947e
commit 6165b3a101
43 changed files with 1898 additions and 1611 deletions

View File

@@ -3,11 +3,64 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Audio/SoundBuffer.hpp>
#include <memory>
#include <Nazara/Audio/Debug.hpp>
namespace Nz
{
/*!
* \brief Gets the duration of the sound buffer
* \return Duration of the sound buffer in milliseconds
*
* \remark Produces a NazaraError if there is no sound buffer with NAZARA_AUDIO_SAFE defined
*/
inline UInt32 SoundBuffer::GetDuration() const
{
return m_duration;
}
/*!
* \brief Gets the format of the sound buffer
* \return Enumeration of type AudioFormat (mono, stereo, ...)
*
* \remark Produces a NazaraError if there is no sound buffer with NAZARA_AUDIO_SAFE defined
*/
inline AudioFormat SoundBuffer::GetFormat() const
{
return m_format;
}
/*!
* \brief Gets the internal raw samples
* \return Pointer to raw data
*
* \remark Produces a NazaraError if there is no sound buffer with NAZARA_AUDIO_SAFE defined
*/
inline const Int16* SoundBuffer::GetSamples() const
{
return m_samples.get();
}
/*!
* \brief Gets the number of samples in the sound buffer
* \return Count of samples (number of seconds * sample rate * channel count)
*
* \remark Produces a NazaraError if there is no sound buffer with NAZARA_AUDIO_SAFE defined
*/
inline UInt64 SoundBuffer::GetSampleCount() const
{
return m_sampleCount;
}
/*!
* \brief Gets the rates of sample in the sound buffer
* \return Rate of sample in Hertz (Hz)
*
* \remark Produces a NazaraError if there is no sound buffer with NAZARA_AUDIO_SAFE defined
*/
inline UInt32 SoundBuffer::GetSampleRate() const
{
return m_sampleRate;
}
}
#include <Nazara/Audio/DebugOff.hpp>