float QALSource::byteOffset() const
{
    float byteOffset;
    alGetSourcef(d->source, AL_BYTE_OFFSET, &byteOffset);

    return byteOffset;
}
Example #2
0
float SoundSource::getMinDistance() const
{
    ALfloat distance;
    alCheck(alGetSourcef(m_source, AL_REFERENCE_DISTANCE, &distance));

    return distance;
}
Example #3
0
	float SoundEmitter::GetPitch() const
	{
		ALfloat pitch;
		alGetSourcef(m_source, AL_PITCH, &pitch);

		return pitch;
	}
Example #4
0
JS_BINDED_PROP_GET_IMPL(FakeAudio, volume)
{
	float vol;
	alGetSourcef(sourceId, AL_GAIN, &vol);
	vp.set(DOUBLE_TO_JSVAL(vol));
	return JS_TRUE;
}
Example #5
0
float SoundSource::getPitch() const
{
    ALfloat pitch;
    alCheck(alGetSourcef(m_source, AL_PITCH, &pitch));

    return pitch;
}
Example #6
0
Uint32 SoundStream::GetPlayingOffset() const
{
    ALfloat seconds = 0.f;
    ALCheck(alGetSourcef(mySource, AL_SEC_OFFSET, &seconds));

    return static_cast<Uint32>(1000 * seconds + 1000 * mySamplesProcessed / mySampleRate / myChannelCount);
}
Example #7
0
JS_BINDED_PROP_GET_IMPL(FakeAudio, muted)
{
	float vol;
	alGetSourcef(sourceId, AL_GAIN, &vol);
	vp.set(BOOLEAN_TO_JSVAL(vol > 0));
	return JS_TRUE;
}
Example #8
0
float OpenALDevice::OpenALHandle::getPosition()
{
	if(!m_status)
		return false;

	std::lock_guard<ILockable> lock(*m_device);

	if(!m_status)
		return 0.0f;

	float position = 0.0f;

	alGetSourcef(m_source, AL_SEC_OFFSET, &position);

	if(!m_isBuffered)
	{
		int queued;

		// this usually always returns CYCLE_BUFFERS
		alGetSourcei(m_source, AL_BUFFERS_QUEUED, &queued);

		Specs specs = m_reader->getSpecs();
		position += (m_reader->getPosition() - m_device->m_buffersize * queued) / (float)specs.rate;
	}

	return position;
}
Example #9
0
	float lime_al_get_sourcef (int source, int param) {
		
		ALfloat data;
		alGetSourcef (source, param, &data);
		return data;
		
	}
float NzSoundEmitter::GetAttenuation() const
{
	ALfloat attenuation;
	alGetSourcef(m_source, AL_ROLLOFF_FACTOR, &attenuation);

	return attenuation;
}
float NzSoundEmitter::GetMinDistance() const
{
	ALfloat distance;
	alGetSourcef(m_source, AL_REFERENCE_DISTANCE, &distance);

	return distance;
}
float QALSource::gain() const
{
    float gain;
    alGetSourcef(d->source, AL_GAIN, &gain);

    return gain;
}
float QALSource::maximumGain() const
{
    float maximumGain;
    alGetSourcef(d->source, AL_MAX_GAIN, &maximumGain);

    return maximumGain;
}
float QALSource::minimumGain() const
{
    float minimumGain;
    alGetSourcef(d->source, AL_MIN_GAIN, &minimumGain);

    return minimumGain;
}
Example #15
0
// Set wav volume
//
// <int> vol = wav volume, 0-100
//
void OpenALAudio::set_wav_volume(int vol)
{
   StreamMap::const_iterator itr;
   float gain;
   float gain_mult;
   int diff;

   if (!this->wav_init_flag)
      return;

   MSG("set_wav_volume(%i)\n", vol);

   vol = MAX(vol, 0);
   vol = MIN(vol, 100);
   vol = vol * 100 - 10000;
   diff = vol - this->wav_volume;
   gain_mult = millibels_to_ratio(diff);

   for (itr = this->streams.begin(); itr != this->streams.end(); ++itr)
   {
      alGetSourcef(itr->second->source, AL_GAIN, &gain);
      alSourcef(itr->second->source, AL_GAIN, gain * gain_mult);
      check_al();
   }

   this->wav_volume = vol;
}
Example #16
0
float plDSoundBuffer::GetTimeOffsetSec()
{
    float time;
    alGetSourcef(source, AL_SEC_OFFSET, &time);
    ALenum error = alGetError();
    return time;
}
Example #17
0
nzUInt32 NzSound::GetPlayingOffset() const
{
	ALfloat seconds = -1.f;
	alGetSourcef(m_source, AL_SEC_OFFSET, &seconds);

	return static_cast<nzUInt32>(seconds*1000);
}
Example #18
0
float OALSound::getVolume()
{
	float volume;
	alGetSourcef(source, AL_GAIN, &volume);
	//checkError();
	return volume;
}
Example #19
0
float CWav::GetPlayedTime() {
  ALfloat sec = 0.0f;
  if (m_AL.source){
    alGetSourcef(m_AL.source, AL_SEC_OFFSET, &sec);
  }
  return sec;
}
Example #20
0
float Sound::GetPlayingOffset() const
{
    ALfloat seconds = 0.f;
    ALCheck(alGetSourcef(mySource, AL_SEC_OFFSET, &seconds));

    return seconds;
}
Example #21
0
JS_BINDED_PROP_GET_IMPL(FakeAudio, currentTime)
{
	float time;
	alGetSourcef(sourceId, AL_SEC_OFFSET, &time);
	vp.set(DOUBLE_TO_JSVAL(time));
	return JS_TRUE;
}
float * ofOpenALSoundPlayer::getCurrentBufferSum(int size){
	if(int(windowedSignal.size())!=size){
		windowedSignal.resize(size);
	}
	windowedSignal.assign(windowedSignal.size(),0);
	for(int k=0;k<int(sources.size())/channels;k++){
		if(!isStreaming){
			ALint state;
			alGetSourcei(sources[k*channels],AL_SOURCE_STATE,&state);
			if( state != AL_PLAYING ) continue;
		}
		int pos;
		alGetSourcei(sources[k*channels],AL_SAMPLE_OFFSET,&pos);
		//if(pos+size>=(int)fftBuffers[0].size()) continue;
		for(int i=0;i<channels;i++){
			float gain;
			alGetSourcef(sources[k*channels+i],AL_GAIN,&gain);
			for(int j=0;j<size;j++){
				if(pos+j<(int)fftBuffers[i].size())
					windowedSignal[j]+=fftBuffers[i][pos+j]*gain;
				else
					windowedSignal[j]=0;
			}
		}
	}
	return &windowedSignal[0];
}
Example #23
0
JS_BINDED_PROP_GET_IMPL(FakeAudio, ended)
{
	float time;
	alGetSourcef(sourceId, AL_SEC_OFFSET, &time);
	vp.set(BOOLEAN_TO_JSVAL(time >= duration));
	return JS_TRUE;
}
Example #24
0
Time Sound::getPlayingOffset() const
{
    ALfloat secs = 0.f;
    alCheck(alGetSourcef(m_source, AL_SEC_OFFSET, &secs));

    return seconds(secs);
}
Example #25
0
float SoundSource::getVolume() const
{
    ALfloat gain;
    alCheck(alGetSourcef(m_source, AL_GAIN, &gain));

    return gain * 100.f;
}
Example #26
0
float MALContext::getSourceOffset(unsigned int sourceId)
{
    M_PROFILE_SCOPE(MALContext::getsourceOffset);
	float time;
	alGetSourcef(sourceId, AL_SEC_OFFSET, &time);
	return time;
}
Example #27
0
float SoundSource::getAttenuation() const
{
    ALfloat attenuation;
    alCheck(alGetSourcef(m_source, AL_ROLLOFF_FACTOR, &attenuation));

    return attenuation;
}
Example #28
0
DsVolume OpenALAudio::get_loop_wav_volume(int id)
{
   StreamContext *sc;
   StreamMap::const_iterator itr;
   float position[3];
   float gain;

   if (!this->wav_init_flag)
      return DsVolume(0, 0);

   itr = this->streams.find(id);
   if (itr == this->streams.end())
      return DsVolume(0, 0);

   sc = itr->second;

   alGetSourcef(sc->source, AL_GAIN, &gain);
   alGetSourcefv(sc->source, AL_POSITION, position);

   if (sc->fade_frames != 0)
      gain *= 1.f - float(sc->fade_frames_played) / sc->fade_frames;

   return DsVolume(ratio_to_millibels(gain),
		(long)((position[0] / PANNING_MAX_X) * 10000.f + .5f)); // (long) cast fixes warning.

}
Example #29
0
	float SoundEmitter::GetVolume() const
	{
		ALfloat gain;
		alGetSourcef(m_source, AL_GAIN, &gain);

		return gain * 100.f;
	}
float QALSource::sampleOffset() const
{
    float sampleOffset;
    alGetSourcef(d->source, AL_SAMPLE_OFFSET, &sampleOffset);

    return sampleOffset;
}