« Return to Thread: Get current volume for a source

Re: Get current volume for a source

by The Big Uno :: Rate this Message:

Reply to Author | View in Thread


>> (On a side note, I am actually using JOAL - Java wrappers for the
>> OpenAL functions - which I believe is currently using the OpenAL 1.0
>> specification.  The JOAL methods map quite closely to the underlying
>> OpenAL API, which is why I am asking here and not on the JOAL
>> forums.  If you can get me the OpenAL function, that would be good
>> enough for me.)
>>  
>
> Oh, then you're out of luck.  The AL_*_OFFSET queries are 1.1
> features.  As far as I know, there isn't any reliable way to do what
> you want in OpenAL 1.0.
>
> --"J"
>
Hmm, please disregard my previous comment - it appears that JOAL has
AL_*_OFFSET queries defined, so it must be using 1.1.  I must have been
looking at outdated documentation when I read that it was 1.0 only.

I am not sure about the methods alGet*v, though - from the documentation
it appears that these are for querying global parameters, as they don't
appear to accept a source pointer as a parameter (page 22, OpenAL 1.1
Specification).  alGetSourcei seems to be more suited to this, and
appears to work from my initial tests.  For anyone reading this list who
may be using JOAL, below is my code:

        int[] position = new int[1];
        al.alGetSourcei(sources[0], AL.AL_BYTE_OFFSET, position, 0);
        System.out.println(position[0]);

This returns an ever- increasing number as it is queried every 100ms.  
 From here, it should be possible to find the current value in the buffer.

Thank you again Jason for putting me on the right track!

Cheers
_______________________________________________
Openal mailing list
Openal@...
http://opensource.creative.com/mailman/listinfo/openal

 « Return to Thread: Get current volume for a source