This commit is contained in:
2025-05-13 02:46:21 +03:00
parent 143e16692e
commit 86914b7fcc
610 changed files with 92343 additions and 2 deletions
+41
View File
@@ -0,0 +1,41 @@
#ifndef StreamedSound_h__
#define StreamedSound_h__
#include "OggStream.h"
#include <math/LifeMath.h>
#include <vector>
#include "ISound.h"
namespace Sound
{
#define BUFFERS_COUNT 2
#define BUFFER_SIZE (4096 * 16)
class StreamedSound : public ISound
{
public:
StreamedSound(OggStream* stm, bool looped);
~StreamedSound();
void Play();
void Stop();
void Update();
void Move(const LifeMath::Vec3f& pos);
bool IsPlaying();
size_t GetPlaybackPosition();
size_t GetByteLength();
void SetPlaybackPosition(float pos);
double GetTimeLength();
void SeekTime(double position);
double GetTimePosition();
private:
ALuint source;
LifeMath::Vec3f position;
LifeMath::Vec3f velocity;
OggStream* data;
char tempBuffer[BUFFER_SIZE];
ALuint buffers[BUFFERS_COUNT];
bool loop;
bool stopped;
};
}
#endif // StreamedSound_h__