mirror of
https://github.com/edubart/otclient.git
synced 2025-10-23 07:45:54 +02:00
get stereo audo working on linux
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user