get stereo audo working on linux

This commit is contained in:
Eduardo Bart
2012-04-14 10:15:51 -03:00
parent ae67c6adbc
commit 8e679f2da7
11 changed files with 311 additions and 47 deletions

View File

@@ -33,9 +33,11 @@ SoundSource::SoundSource()
SoundSource::~SoundSource()
{
stop();
alDeleteSources(1, &m_sourceId);
assert(alGetError() == AL_NO_ERROR);
if(m_sourceId != 0) {
stop();
alDeleteSources(1, &m_sourceId);
assert(alGetError() == AL_NO_ERROR);
}
}
void SoundSource::play()
@@ -93,3 +95,13 @@ void SoundSource::setPitch(float pitch)
{
alSourcef(m_sourceId, AL_PITCH, pitch);
}
void SoundSource::setPosition(const Point& pos)
{
alSource3f(m_sourceId, AL_POSITION, pos.x, pos.y, 0);
}
void SoundSource::setVelocity(const Point& velocity)
{
alSource3f(m_sourceId, AL_VELOCITY, velocity.x, velocity.y, 0);
}