This commit is contained in:
Aaldert
2016-06-20 13:43:13 +02:00
parent f84fcfa4e2
commit b7d73c9abe
7 changed files with 31 additions and 5 deletions
+9 -1
View File
@@ -8,8 +8,9 @@ Sound::Sound(const char* inWavPath, bool inLooping):
buffer_id(0),
source_id(0),
is_looping(inLooping)
{
isPlaying = false;
const char* path = inWavPath;
FILE *fp = fopen(path, "rb"); // Open the WAVE file
@@ -121,6 +122,7 @@ void Sound::SetPos(const Vec3f& inPos, const Vec3f& inVel)
void Sound::Play()
{
isPlaying = true;
alSourcePlay(source_id);
int e = alGetError(); // != AL_NO_ERROR) return;
}
@@ -134,6 +136,12 @@ void Sound::Pause()
void Sound::Stop()
{
isPlaying = false;
alSourceStop(source_id);
}
bool Sound::IsPlaying()
{
return isPlaying;
}