PCMStream, msvc build fix, sound is an asset now

This commit is contained in:
MihailRis
2024-02-28 12:37:53 +03:00
parent 96ad7664c4
commit 33b39dfece
8 changed files with 109 additions and 30 deletions
+1
View File
@@ -12,6 +12,7 @@
#endif
#include <glm/glm.hpp>
#include "../typedefs.h"
#define AL_CHECK(STATEMENT) STATEMENT; AL::check_errors(__FILE__, __LINE__)
#define AL_GET_ERORR() AL::check_errors(__FILE__, __LINE__)
+14
View File
@@ -55,6 +55,20 @@ namespace audio {
}
};
/// @brief PCM data streaming interface
class PCMStream {
public:
virtual ~PCMStream() {};
virtual size_t read(char* buffer, size_t bufferSize, bool loop)=0;
virtual void close()=0;
virtual size_t getTotalSamples() const=0;
virtual duration_t getTotalDuration() const=0;
virtual uint getChannels() const=0;
virtual uint getSampleRate() const=0;
virtual uint getBitsPerSample() const=0;
};
/// @brief Sound is an audio asset that supposed to support many
/// simultaneously playing instances with different sources.
/// So it's audio data is stored in memory.