-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Audio/AudioData] Added a type dedicated to just audio data
- A Sound can be constructed with and load an AudioData object - The individual members of Sound are replaced with AudioData - Microphone's and WavFormat's functions now return & take AudioData objects instead of Sound ones - Removed Microphone::recoverSound(), now useless - Removed the Internal::SoundAccess type, now unneeded
- Loading branch information
Showing
16 changed files
with
223 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#pragma once | ||
|
||
#ifndef RAZ_AUDIODATA_HPP | ||
#define RAZ_AUDIODATA_HPP | ||
|
||
#include <cstdint> | ||
#include <vector> | ||
|
||
namespace Raz { | ||
|
||
enum class AudioFormat : int { | ||
MONO_U8 = 4352 /* AL_FORMAT_MONO8 */, ///< Mono format on 8 unsigned bits (0 to 255). | ||
STEREO_U8 = 4354 /* AL_FORMAT_STEREO8 */, ///< Stereo format on 8 unsigned bits (0 to 255). | ||
MONO_I16 = 4353 /* AL_FORMAT_MONO16 */, ///< Mono format on 16 signed bits (-32768 to 32767). | ||
STEREO_I16 = 4355 /* AL_FORMAT_STEREO16 */, ///< Stereo format on 16 signed bits (-32768 to 32767). | ||
MONO_F32 = 65552 /* AL_FORMAT_MONO_FLOAT32 */, ///< Mono format on 32 floating-point bits (float). | ||
STEREO_F32 = 65553 /* AL_FORMAT_STEREO_FLOAT32 */, ///< Stereo format on 32 floating-point bits (float). | ||
MONO_F64 = 65554 /* AL_FORMAT_MONO_DOUBLE_EXT */, ///< Mono format on 64 floating-point bits (double). | ||
STEREO_F64 = 65555 /* AL_FORMAT_STEREO_DOUBLE_EXT */ ///< Stereo format on 64 floating-point bits (double). | ||
}; | ||
|
||
struct AudioData { | ||
AudioFormat format {}; | ||
unsigned int frequency {}; | ||
std::vector<uint8_t> buffer {}; | ||
}; | ||
|
||
} // namespace Raz | ||
|
||
#endif // RAZ_AUDIODATA_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.