Re: [Gambas-user] OpenAL (gb.openal) example code

2015-10-21 Thread Benoît Minisini
Le 15/09/2015 07:49, Kevin Fishburne a écrit :
>
> When I've gotten most everything I need figured out I'll write a
> tutorial to accompany the example code. This hopefully will be sooner
> than later.
>
> Currently using Alure.BufferDataFromFile to load sound files into OpenAL
> buffers I'm unable to get the buffer properties using the Al.GetBufferi
> function. I don't know if this is because I'm using Alure versus the
> regular Al method, but this code should work and doesn't (see attached
> project):
>
>' Load audio data from .wav file into audio buffer.
>Print "Load buffer data from wav file:" & Gb.CrLf & "  ";
>Print Alure.BufferDataFromFile("./test.ogg", AudioBuffer[0])
>
>' Display audio data properties.
>Print "Audio frequency in Hz:" & Gb.CrLf & "  ";
>Print Al.GetBufferi(AudioBuffer[0], Al.FREQUENCY)
>Print "Audio buffer bit depth:" & Gb.CrLf & "  ";
>Print Al.GetBufferi(AudioBuffer[0], Al.BITS)
>Print "Audio channels:" & Gb.CrLf & "  ";
>Print Al.GetBufferi(AudioBuffer[0], Al.CHANNELS)
>Print "Audio data size in bytes:" & Gb.CrLf & "  ";
>Print Al.GetBufferi(AudioBuffer[0], Al.SIZE)
>
> It returns zeros instead of the proper values. In particular I need the
> Size property returned, as this can be used to calculate an offset from
> which to start playing a sample once attached to a source. This is
> necessary because multiple sources created and played simultaneously
> using the same buffer will result in the waveforms being combined at the
> same sample point, which creates a metallic, flange-like effect. If I
> can find a buffer's size I can offset the position at which a source
> begins to play randomly between zero and the buffer's size like this:
>
> Al.Sourcei(Ship[ShipIndex].AudioSourceVelocity[0], Al.BYTE_OFFSET,
> Rnd(0, Al.GetBufferi(AudioBufferVelocity[0], Al.SIZE)))
>
> For now I'm going to have to use something like Rnd(0, 10) for the
> offset and simply hope it doesn't exceed the buffer's size, which
> silently returns an error and plays the source at zero (no offset).
>

Is is better with revision #7428?

-- 
Benoît Minisini

--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] OpenAL (gb.openal) example code

2015-10-20 Thread Benoît Minisini
Le 20/10/2015 07:40, Kevin Fishburne a écrit :
> On 09/15/2015 01:49 AM, Kevin Fishburne wrote:
>>
>> Currently using Alure.BufferDataFromFile to load sound files into
>> OpenAL buffers I'm unable to get the buffer properties using the
>> Al.GetBufferi function. I don't know if this is because I'm using
>> Alure versus the regular Al method, but this code should work and
>> doesn't (see attached project):
>>
>>' Load audio data from .wav file into audio buffer.
>>Print "Load buffer data from wav file:" & Gb.CrLf & " ";
>>Print Alure.BufferDataFromFile("./test.ogg", AudioBuffer[0])
>>
>>' Display audio data properties.
>>Print "Audio frequency in Hz:" & Gb.CrLf & "  ";
>>Print Al.GetBufferi(AudioBuffer[0], Al.FREQUENCY)
>>Print "Audio buffer bit depth:" & Gb.CrLf & "  ";
>>Print Al.GetBufferi(AudioBuffer[0], Al.BITS)
>>Print "Audio channels:" & Gb.CrLf & "  ";
>>Print Al.GetBufferi(AudioBuffer[0], Al.CHANNELS)
>>Print "Audio data size in bytes:" & Gb.CrLf & "  ";
>>Print Al.GetBufferi(AudioBuffer[0], Al.SIZE)
>>
>> It returns zeros instead of the proper values. In particular I need
>> the Size property returned, as this can be used to calculate an offset
>> from which to start playing a sample once attached to a source. This
>> is necessary because multiple sources created and played
>> simultaneously using the same buffer will result in the waveforms
>> being combined at the same sample point, which creates a metallic,
>> flange-like effect. If I can find a buffer's size I can offset the
>> position at which a source begins to play randomly between zero and
>> the buffer's size like this:
>>
>> Al.Sourcei(Ship[ShipIndex].AudioSourceVelocity[0], Al.BYTE_OFFSET,
>> Rnd(0, Al.GetBufferi(AudioBufferVelocity[0], Al.SIZE)))
>>
>> For now I'm going to have to use something like Rnd(0, 10) for the
>> offset and simply hope it doesn't exceed the buffer's size, which
>> silently returns an error and plays the source at zero (no offset).
>
> Having not gotten a response I'll try again. There's now a second
> critical use case where I need to retrieve the properties of an OpenAL
> buffer. According to multiple Internet posts such as this one:
>
> http://stackoverflow.com/questions/7978912/how-to-get-length-duration-of-a-source-with-single-buffer-in-openal
>
> I'm using the correct method with the possible exception of relying upon
> Alure to load the buffer (which you'd think would be irrelevant since a
> buffer is a buffer is a buffer and all). Please see the OpenAL example
> in the GAMBAS software farm to test the failing code. I'm using Mint
> 17.2 amd64 and GAMBAS from the stable PPA. There (as usual) is a
> possibility I'm just doing something really stupid, or there could be a
> legitimate problem with the OpenAL implementation in Alure or GAMBAS.

Sorry, I forgot to look at your problems...

>
> On an unrelated note, I finally watched Benoît's interview. A few
> things... First Benoît's English was good enough that I could understand
> about 80%+ of what he was saying. Second, the two guys doing the
> interview didn't seem to know their assholes from their elbows,
> especially the older Mac guy. Benoît, you were outstanding and your
> passion for both GAMBAS and BASIC really shone through; nice work and it
> was awesome seeing and hearing you talk about your (and our) passion.
> Also around the 23:00 mark you gave me a shout-out by name. I nearly
> shit myself. :)
>

...maybe this is the reason why I mentioned your name: I knew 
unconsciously that I had something to do relative to you. :-)

-- 
Benoît Minisini

--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] OpenAL (gb.openal) example code

2015-10-20 Thread Kevin Fishburne
On 10/20/2015 05:45 PM, Benoît Minisini wrote:
> Le 20/10/2015 07:40, Kevin Fishburne a écrit :
>> On 09/15/2015 01:49 AM, Kevin Fishburne wrote:
>>> Currently using Alure.BufferDataFromFile to load sound files into
>>> OpenAL buffers I'm unable to get the buffer properties using the
>>> Al.GetBufferi function. I don't know if this is because I'm using
>>> Alure versus the regular Al method, but this code should work and
>>> doesn't (see attached project):
>>>
>>> ' Load audio data from .wav file into audio buffer.
>>> Print "Load buffer data from wav file:" & Gb.CrLf & " ";
>>> Print Alure.BufferDataFromFile("./test.ogg", AudioBuffer[0])
>>>
>>> ' Display audio data properties.
>>> Print "Audio frequency in Hz:" & Gb.CrLf & "  ";
>>> Print Al.GetBufferi(AudioBuffer[0], Al.FREQUENCY)
>>> Print "Audio buffer bit depth:" & Gb.CrLf & "  ";
>>> Print Al.GetBufferi(AudioBuffer[0], Al.BITS)
>>> Print "Audio channels:" & Gb.CrLf & "  ";
>>> Print Al.GetBufferi(AudioBuffer[0], Al.CHANNELS)
>>> Print "Audio data size in bytes:" & Gb.CrLf & "  ";
>>> Print Al.GetBufferi(AudioBuffer[0], Al.SIZE)
>>>
>>> It returns zeros instead of the proper values. In particular I need
>>> the Size property returned, as this can be used to calculate an offset
>>> from which to start playing a sample once attached to a source. This
>>> is necessary because multiple sources created and played
>>> simultaneously using the same buffer will result in the waveforms
>>> being combined at the same sample point, which creates a metallic,
>>> flange-like effect. If I can find a buffer's size I can offset the
>>> position at which a source begins to play randomly between zero and
>>> the buffer's size like this:
>>>
>>> Al.Sourcei(Ship[ShipIndex].AudioSourceVelocity[0], Al.BYTE_OFFSET,
>>> Rnd(0, Al.GetBufferi(AudioBufferVelocity[0], Al.SIZE)))
>>>
>>> For now I'm going to have to use something like Rnd(0, 10) for the
>>> offset and simply hope it doesn't exceed the buffer's size, which
>>> silently returns an error and plays the source at zero (no offset).
>> Having not gotten a response I'll try again. There's now a second
>> critical use case where I need to retrieve the properties of an OpenAL
>> buffer. According to multiple Internet posts such as this one:
>>
>> http://stackoverflow.com/questions/7978912/how-to-get-length-duration-of-a-source-with-single-buffer-in-openal
>>
>> I'm using the correct method with the possible exception of relying upon
>> Alure to load the buffer (which you'd think would be irrelevant since a
>> buffer is a buffer is a buffer and all). Please see the OpenAL example
>> in the GAMBAS software farm to test the failing code. I'm using Mint
>> 17.2 amd64 and GAMBAS from the stable PPA. There (as usual) is a
>> possibility I'm just doing something really stupid, or there could be a
>> legitimate problem with the OpenAL implementation in Alure or GAMBAS.
> Sorry, I forgot to look at your problems...
>
>> On an unrelated note, I finally watched Benoît's interview. A few
>> things... First Benoît's English was good enough that I could understand
>> about 80%+ of what he was saying. Second, the two guys doing the
>> interview didn't seem to know their assholes from their elbows,
>> especially the older Mac guy. Benoît, you were outstanding and your
>> passion for both GAMBAS and BASIC really shone through; nice work and it
>> was awesome seeing and hearing you talk about your (and our) passion.
>> Also around the 23:00 mark you gave me a shout-out by name. I nearly
>> shit myself. :)
>>
> ...maybe this is the reason why I mentioned your name: I knew
> unconsciously that I had something to do relative to you. :-)
>

Haha, perhaps. Maybe from now on I'll start submitting formal bug 
reports. That way they'll stay there waiting, forever, looking at you 
with their sad, compound eyes until you can provide them a merciful coup 
de grâce.

-- 
Kevin Fishburne
Eight Virtues
www: http://sales.eightvirtues.com
e-mail: sa...@eightvirtues.com
phone: (770) 853-6271


--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] OpenAL (gb.openal) example code

2015-10-19 Thread Kevin Fishburne
On 09/15/2015 01:49 AM, Kevin Fishburne wrote:
>
> Currently using Alure.BufferDataFromFile to load sound files into 
> OpenAL buffers I'm unable to get the buffer properties using the 
> Al.GetBufferi function. I don't know if this is because I'm using 
> Alure versus the regular Al method, but this code should work and 
> doesn't (see attached project):
>
>   ' Load audio data from .wav file into audio buffer.
>   Print "Load buffer data from wav file:" & Gb.CrLf & " ";
>   Print Alure.BufferDataFromFile("./test.ogg", AudioBuffer[0])
>
>   ' Display audio data properties.
>   Print "Audio frequency in Hz:" & Gb.CrLf & "  ";
>   Print Al.GetBufferi(AudioBuffer[0], Al.FREQUENCY)
>   Print "Audio buffer bit depth:" & Gb.CrLf & "  ";
>   Print Al.GetBufferi(AudioBuffer[0], Al.BITS)
>   Print "Audio channels:" & Gb.CrLf & "  ";
>   Print Al.GetBufferi(AudioBuffer[0], Al.CHANNELS)
>   Print "Audio data size in bytes:" & Gb.CrLf & "  ";
>   Print Al.GetBufferi(AudioBuffer[0], Al.SIZE)
>
> It returns zeros instead of the proper values. In particular I need 
> the Size property returned, as this can be used to calculate an offset 
> from which to start playing a sample once attached to a source. This 
> is necessary because multiple sources created and played 
> simultaneously using the same buffer will result in the waveforms 
> being combined at the same sample point, which creates a metallic, 
> flange-like effect. If I can find a buffer's size I can offset the 
> position at which a source begins to play randomly between zero and 
> the buffer's size like this:
>
> Al.Sourcei(Ship[ShipIndex].AudioSourceVelocity[0], Al.BYTE_OFFSET, 
> Rnd(0, Al.GetBufferi(AudioBufferVelocity[0], Al.SIZE)))
>
> For now I'm going to have to use something like Rnd(0, 10) for the 
> offset and simply hope it doesn't exceed the buffer's size, which 
> silently returns an error and plays the source at zero (no offset).

Having not gotten a response I'll try again. There's now a second 
critical use case where I need to retrieve the properties of an OpenAL 
buffer. According to multiple Internet posts such as this one:

http://stackoverflow.com/questions/7978912/how-to-get-length-duration-of-a-source-with-single-buffer-in-openal

I'm using the correct method with the possible exception of relying upon 
Alure to load the buffer (which you'd think would be irrelevant since a 
buffer is a buffer is a buffer and all). Please see the OpenAL example 
in the GAMBAS software farm to test the failing code. I'm using Mint 
17.2 amd64 and GAMBAS from the stable PPA. There (as usual) is a 
possibility I'm just doing something really stupid, or there could be a 
legitimate problem with the OpenAL implementation in Alure or GAMBAS.

On an unrelated note, I finally watched Benoît's interview. A few 
things... First Benoît's English was good enough that I could understand 
about 80%+ of what he was saying. Second, the two guys doing the 
interview didn't seem to know their assholes from their elbows, 
especially the older Mac guy. Benoît, you were outstanding and your 
passion for both GAMBAS and BASIC really shone through; nice work and it 
was awesome seeing and hearing you talk about your (and our) passion. 
Also around the 23:00 mark you gave me a shout-out by name. I nearly 
shit myself. :)

-- 
Kevin Fishburne
Eight Virtues
www: http://sales.eightvirtues.com
e-mail: sa...@eightvirtues.com
phone: (770) 853-6271


--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] OpenAL (gb.openal) example code

2015-09-10 Thread Kevin Fishburne
On 09/07/2015 01:42 AM, Kevin Fishburne wrote:
>
> I now have OpenAL working well but I need to know how to change the
> orientation of the coordinate system to reflect that used by my game.
> Normally in a 3D game the X axis is left/right, the Y axis is
> up/down/elevation, and the Z axis goes into the screen (in/out). In
> Sylph the Y axis goes into the screen and the Z axis is
> up/down/elevation. As you move into the screen the Y coordinates
> decrease. An easy way to think about it is a piece of graph paper where
> the upper-left corner is X:0, Y:0 and the bottom-right corner is X:100,
> Y:100. You start at the bottom, facing the top, and move along the Y
> axis toward the top.
>
> I believe that
>
> Al.Listenerfv(Al.ORIENTATION, [0, 0, -1, 0, 1, 0])
>
> orients the audio environment using the traditional axes and not mine
> where the Z and Y axes are switched. I have no idea how to calculate the
> proper values for this statement to reflect the axes used in Sylph.
>
> Here's another explanation of how the two vectors in Al.Listenerfv work:
>
> http://stackoverflow.com/questions/7861306/clarification-on-openal-listener-orientation
>
> If the answer is obvious to anyone reading this, please clue me in.

I've only tested this on a 2.0 (stereo) audio setup, so there is some 
chance that the front and rear speakers will be reversed, but these are 
the two sets of values for the listener orientation for the two 
coordinate orientations I mentioned.

For a game where the Z axis goes "into" the screen and the Y axis is 
height/elevation (the normal way things are done), this works:

Al.Listenerfv(Al.ORIENTATION, [0, 0, -1, 0, 1, 0])

For a game where the Y axis goes "into" the screen and the Z axis is 
height/elevation (what Sylph uses), this works:

Al.Listenerfv(Al.ORIENTATION, [0, -1, 0, 0, 0, -1])

In a game where the camera's orientation is completely arbitrary (an FPS 
or flight sim, for example) the listener orientation should correspond 
to the "camera" orientation.

Something else to note about OpenAL is that if a sample/sound file is 
multichannel (stereo, for example) 3D positioning and doppler effects 
will be ignored and the sound will play equally on all speakers (like 
you were playing music in a media player). If you want a sound effect to 
use 3D positioning and doppler effects it must be mono (one channel). 
You can use a program like Audacity to check/correct this.

-- 
Kevin Fishburne
Eight Virtues
www: http://sales.eightvirtues.com
e-mail: sa...@eightvirtues.com
phone: (770) 853-6271


--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] OpenAL (gb.openal) example code

2015-09-10 Thread Benoît Minisini
Le 11/09/2015 04:12, Kevin Fishburne a écrit :
> On 09/07/2015 01:42 AM, Kevin Fishburne wrote:
>>
>> I now have OpenAL working well but I need to know how to change the
>> orientation of the coordinate system to reflect that used by my game.
>> Normally in a 3D game the X axis is left/right, the Y axis is
>> up/down/elevation, and the Z axis goes into the screen (in/out). In
>> Sylph the Y axis goes into the screen and the Z axis is
>> up/down/elevation. As you move into the screen the Y coordinates
>> decrease. An easy way to think about it is a piece of graph paper where
>> the upper-left corner is X:0, Y:0 and the bottom-right corner is X:100,
>> Y:100. You start at the bottom, facing the top, and move along the Y
>> axis toward the top.
>>
>> I believe that
>>
>> Al.Listenerfv(Al.ORIENTATION, [0, 0, -1, 0, 1, 0])
>>
>> orients the audio environment using the traditional axes and not mine
>> where the Z and Y axes are switched. I have no idea how to calculate the
>> proper values for this statement to reflect the axes used in Sylph.
>>
>> Here's another explanation of how the two vectors in Al.Listenerfv work:
>>
>> http://stackoverflow.com/questions/7861306/clarification-on-openal-listener-orientation
>>
>> If the answer is obvious to anyone reading this, please clue me in.
>
> I've only tested this on a 2.0 (stereo) audio setup, so there is some
> chance that the front and rear speakers will be reversed, but these are
> the two sets of values for the listener orientation for the two
> coordinate orientations I mentioned.
>
> For a game where the Z axis goes "into" the screen and the Y axis is
> height/elevation (the normal way things are done), this works:
>
> Al.Listenerfv(Al.ORIENTATION, [0, 0, -1, 0, 1, 0])
>
> For a game where the Y axis goes "into" the screen and the Z axis is
> height/elevation (what Sylph uses), this works:
>
> Al.Listenerfv(Al.ORIENTATION, [0, -1, 0, 0, 0, -1])
>
> In a game where the camera's orientation is completely arbitrary (an FPS
> or flight sim, for example) the listener orientation should correspond
> to the "camera" orientation.
>
> Something else to note about OpenAL is that if a sample/sound file is
> multichannel (stereo, for example) 3D positioning and doppler effects
> will be ignored and the sound will play equally on all speakers (like
> you were playing music in a media player). If you want a sound effect to
> use 3D positioning and doppler effects it must be mono (one channel).
> You can use a program like Audacity to check/correct this.
>

You should put that in a wiki article...

-- 
Benoît Minisini

--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] OpenAL (gb.openal) example code

2015-09-06 Thread Kevin Fishburne
On 08/23/2015 12:43 AM, Kevin Fishburne wrote:
>
> Okay, I found this code:
>
> https://hackage.haskell.org/package/OpenAL-1.4.0.1/docs/src/Sound-OpenAL-AL-Listener.html
>
> with perhaps this being the pertinent information in its comments:
>
> -- | 'orientation' contains an \"at\" vector and an \"up\" vector, where the
> -- \"at\" vector represents the \"forward\" direction of the listener
> and the
> -- orthogonal projection of the \"up\" vector into the subspace
> perpendicular to
> -- the \"at\" vector represents the \"up\" direction for the listener.
> OpenAL
> -- expects two vectors that are linearly independent. These vectors are not
> -- expected to be normalized. If the two vectors are linearly dependent,
> -- behavior is undefined. The initial orientation is ('Vector3' 0 0 (-1),
> -- 'Vector3' 0 1 0), i.e. looking down the Z axis with the Y axis pointing
> -- upwards.
>
> I changed the listener orientation vector assignment line to this:
>
> Al.Listenerfv(Al.ORIENTATION, [0, 0, -1, 0, 1, 0])
>
> and it seems to work with Al.SOURCE_RELATIVE set to FALSE for both
> listener and source position changes. Yummy. Let me know if any of this
> sounds correct and I'll continue testing/experimentation.
>

I now have OpenAL working well but I need to know how to change the 
orientation of the coordinate system to reflect that used by my game. 
Normally in a 3D game the X axis is left/right, the Y axis is 
up/down/elevation, and the Z axis goes into the screen (in/out). In 
Sylph the Y axis goes into the screen and the Z axis is 
up/down/elevation. As you move into the screen the Y coordinates 
decrease. An easy way to think about it is a piece of graph paper where 
the upper-left corner is X:0, Y:0 and the bottom-right corner is X:100, 
Y:100. You start at the bottom, facing the top, and move along the Y 
axis toward the top.

I believe that

Al.Listenerfv(Al.ORIENTATION, [0, 0, -1, 0, 1, 0])

orients the audio environment using the traditional axes and not mine 
where the Z and Y axes are switched. I have no idea how to calculate the 
proper values for this statement to reflect the axes used in Sylph.

Here's another explanation of how the two vectors in Al.Listenerfv work:

http://stackoverflow.com/questions/7861306/clarification-on-openal-listener-orientation

If the answer is obvious to anyone reading this, please clue me in.

-- 
Kevin Fishburne
Eight Virtues
www:http://sales.eightvirtues.com
e-mail:sa...@eightvirtues.com
phone: (770) 853-6271


--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] OpenAL (gb.openal) example code and problem loading .wav files

2015-08-22 Thread Kevin Fishburne
On 08/21/2015 02:51 PM, Benoît Minisini wrote:
 Le 21/08/2015 06:39, Kevin Fishburne a écrit :
 Okay Benoît, you can take me off your list of people to kill now that
 I've finally gotten around to implementing OpenAL. :)

 You will be the one who will test gb.openal!

 Don't hesitate to publich the OpenAL example to the Gambas software
 repository.


Heh, yes I will. I test; you fix. :)

Thanks everyone for the responses and fix to the code. Now that I got 
the very basics working (can load and play a sound) I'll start working 
on getting 3D positioning, doppler, etc. working and will put together a 
nice demo. When it's polished I'll upload it to the farm so others may 
benefit. Once that's done I'll begin replacing the SDL audio code in 
Sylph and put a video up on YouTube to show off the new audio capabilities.

-- 
Kevin Fishburne
Eight Virtues
www: http://sales.eightvirtues.com
e-mail: sa...@eightvirtues.com
phone: (770) 853-6271


--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] OpenAL (gb.openal) example code

2015-08-22 Thread Kevin Fishburne
On 08/22/2015 10:56 AM, Kevin Fishburne wrote:
 Heh, yes I will. I test; you fix. :) Thanks everyone for the responses 
 and fix to the code. Now that I got the very basics working (can load 
 and play a sound) I'll start working on getting 3D positioning, 
 doppler, etc. working and will put together a nice demo. When it's 
 polished I'll upload it to the farm so others may benefit. Once that's 
 done I'll begin replacing the SDL audio code in Sylph and put a video 
 up on YouTube to show off the new audio capabilities. 

Okay, after searching through tons of shitty old web examples, actually 
reading the frakking manual from 2001 (not the movie) and some 
experimentation I've made a little progress. Here's the link to the new 
project revision:

http://eightvirtues.com/misc/OpenAL.tar.gz

To a limited degree I can get 3D positional audio and doppler based on 
velocity working, but only by changing the relevant parameters for the 
audio source and not the listener. I also have to set this to TRUE, not 
FALSE:

Al.Sourcei(AudioSource[0], Al.SOURCE_RELATIVE, Al.TRUE)

Ideally it should be FALSE as the camera (listener) moves as well as 
the audio sources (space ships and such), and having audio source 
positions calculated relative to the listener position doesn't allow me 
to use global/scene coordinates for both and would be unnatural for most 
3D games.

I'm wondering if the line:

Al.Listenerfv(Al.ORIENTATION, [0, 0, -1])

may be incorrect, as the Gambas documentation says it should have more 
parameters but online docs say otherwise.

Right now I'm testing this using two-channel stereo. Once that's working 
I'll test it on a 5.1 system.

-- 
Kevin Fishburne
Eight Virtues
www: http://sales.eightvirtues.com
e-mail: sa...@eightvirtues.com
phone: (770) 853-6271


--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] OpenAL (gb.openal) example code and problem loading .wav files

2015-08-22 Thread Ru Vuott
I wrote this page:

http://www.gambas-it.org/wiki/index.php?title=La_gestione_mediante_il_componente_gb.openal





Ven 21/8/15, Benoît Minisini gam...@users.sourceforge.net ha scritto:

 Oggetto: Re: [Gambas-user] OpenAL (gb.openal) example code and problem loading 
.wav files
 A: mailing list for gambas users gambas-user@lists.sourceforge.net
 Data: Venerdì 21 agosto 2015, 20:51
 
 Le 21/08/2015 06:39,
 Kevin Fishburne a écrit :
  Okay
 Benoît, you can take me off your list of people to kill now
 that
  I've finally gotten around to
 implementing OpenAL. :)
 
  The documentation online is pretty
 spartan, with much of it being
 
 outdated, but I still managed to set things up reasonably
 well to play a
  sine wave at a specified
 frequency and I think I've found the function
  to load a .wav file into an audio buffer
 in order to play it. The latter
 
 doesn't work, however. The alure class seems
 to be similar to glu in
 
 that it's a high-level helper class to make
 common functions easy,
  such as loading
 sound files directly.
 
  This line should load the .wav file into
 the buffer and allow me to play
  it, but
 it returns False:
 
 
 Print Alure.BufferDataFromFile(./test.wav,
 AudioBuffer[0])
 
 
 Here's the example project if anyone wants to play with
 it:
 
  http://eightvirtues.com/misc/OpenAL_Example.tar.gz
 
  This issue is
 probably unrelated, but on running the program this
  message displays in the debug window:
 
  Error loading
 libdumb.so.1: libdumb.so.1: cannot open shared object
  file: No such file or directory
 
  libdumb is described
 as DUMB is a tracker library with support for IT,
  XM, S3M and MOD files. so I
 don't think that's an issue here. If OpenAL
  support it however, the library might need
 to be added as a dependency
  during
 compilation.
 
 
 You will be the one who will test gb.openal!
 
 Don't hesitate to publich
 the OpenAL example to the Gambas software 
 repository.
 
 Regards,
 
 --
 
 Benoît Minisini
 
 --
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user
 

--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] OpenAL (gb.openal) example code and problem loading .wav files

2015-08-21 Thread Ru Vuott
 one allocation is not freed... I don't know what it is.


...because we have to destroy also the audio context:

  Alc.DestroyContext(AudioContext)

Regards
vuott




Ven 21/8/15, Jussi Lahtinen jussi.lahti...@gmail.com ha scritto:

 Oggetto: Re: [Gambas-user] OpenAL (gb.openal) example code and problem loading 
.wav files
 A: mailing list for gambas users gambas-user@lists.sourceforge.net
 Data: Venerdì 21 agosto 2015, 19:15
 
 Fixed code attached.
 However, one allocation is not freed... I don't know
 what it is.
 
 
 Jussi
 
 On
 Fri, Aug 21, 2015 at 7:39 AM, Kevin Fishburne 
 kevinfishbu...@eightvirtues.com
 wrote:
 
  Okay Benoît,
 you can take me off your list of people to kill now that
  I've finally gotten around to
 implementing OpenAL. :)
 
  The documentation online is pretty
 spartan, with much of it being
 
 outdated, but I still managed to set things up reasonably
 well to play a
  sine wave at a specified
 frequency and I think I've found the function
  to load a .wav file into an audio buffer
 in order to play it. The latter
 
 doesn't work, however. The alure class seems
 to be similar to glu in
 
 that it's a high-level helper class to make
 common functions easy,
  such as loading
 sound files directly.
 
  This line should load the .wav file into
 the buffer and allow me to play
  it, but
 it returns False:
 
 
 Print Alure.BufferDataFromFile(./test.wav,
 AudioBuffer[0])
 
 
 Here's the example project if anyone wants to play with
 it:
 
  http://eightvirtues.com/misc/OpenAL_Example.tar.gz
 
  This issue is
 probably unrelated, but on running the program this
  message displays in the debug window:
 
  Error loading
 libdumb.so.1: libdumb.so.1: cannot open shared object
  file: No such file or directory
 
  libdumb is described
 as DUMB is a tracker library with support for IT,
  XM, S3M and MOD files. so I
 don't think that's an issue here. If OpenAL
  support it however, the library might need
 to be added as a dependency
  during
 compilation.
 
  --
  Kevin Fishburne
  Eight
 Virtues
  www: http://sales.eightvirtues.com
  e-mail: sa...@eightvirtues.com
  phone: (770) 853-6271
 
 
 
 
 --
 
 ___
  Gambas-user mailing list
  Gambas-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/gambas-user
 
 -Segue allegato-
 
 --
 
 -Segue allegato-
 
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user
 

--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] OpenAL (gb.openal) example code and problem loading .wav files

2015-08-21 Thread Jussi Lahtinen
Fixed code attached. However, one allocation is not freed... I don't know
what it is.


Jussi

On Fri, Aug 21, 2015 at 7:39 AM, Kevin Fishburne 
kevinfishbu...@eightvirtues.com wrote:

 Okay Benoît, you can take me off your list of people to kill now that
 I've finally gotten around to implementing OpenAL. :)

 The documentation online is pretty spartan, with much of it being
 outdated, but I still managed to set things up reasonably well to play a
 sine wave at a specified frequency and I think I've found the function
 to load a .wav file into an audio buffer in order to play it. The latter
 doesn't work, however. The alure class seems to be similar to glu in
 that it's a high-level helper class to make common functions easy,
 such as loading sound files directly.

 This line should load the .wav file into the buffer and allow me to play
 it, but it returns False:

 Print Alure.BufferDataFromFile(./test.wav, AudioBuffer[0])

 Here's the example project if anyone wants to play with it:

 http://eightvirtues.com/misc/OpenAL_Example.tar.gz

 This issue is probably unrelated, but on running the program this
 message displays in the debug window:

 Error loading libdumb.so.1: libdumb.so.1: cannot open shared object
 file: No such file or directory

 libdumb is described as DUMB is a tracker library with support for IT,
 XM, S3M and MOD files. so I don't think that's an issue here. If OpenAL
 support it however, the library might need to be added as a dependency
 during compilation.

 --
 Kevin Fishburne
 Eight Virtues
 www: http://sales.eightvirtues.com
 e-mail: sa...@eightvirtues.com
 phone: (770) 853-6271



 --
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user



Source-0.0.3.tar.gz
Description: GNU Zip compressed data
--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] OpenAL (gb.openal) example code and problem loading .wav files

2015-08-21 Thread Benoît Minisini
Le 21/08/2015 06:39, Kevin Fishburne a écrit :
 Okay Benoît, you can take me off your list of people to kill now that
 I've finally gotten around to implementing OpenAL. :)

 The documentation online is pretty spartan, with much of it being
 outdated, but I still managed to set things up reasonably well to play a
 sine wave at a specified frequency and I think I've found the function
 to load a .wav file into an audio buffer in order to play it. The latter
 doesn't work, however. The alure class seems to be similar to glu in
 that it's a high-level helper class to make common functions easy,
 such as loading sound files directly.

 This line should load the .wav file into the buffer and allow me to play
 it, but it returns False:

 Print Alure.BufferDataFromFile(./test.wav, AudioBuffer[0])

 Here's the example project if anyone wants to play with it:

 http://eightvirtues.com/misc/OpenAL_Example.tar.gz

 This issue is probably unrelated, but on running the program this
 message displays in the debug window:

 Error loading libdumb.so.1: libdumb.so.1: cannot open shared object
 file: No such file or directory

 libdumb is described as DUMB is a tracker library with support for IT,
 XM, S3M and MOD files. so I don't think that's an issue here. If OpenAL
 support it however, the library might need to be added as a dependency
 during compilation.


You will be the one who will test gb.openal!

Don't hesitate to publich the OpenAL example to the Gambas software 
repository.

Regards,

-- 
Benoît Minisini

--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] OpenAL (gb.openal) example code and problem loading .wav files

2015-08-21 Thread Jussi Lahtinen
 ...because we have to destroy also the audio context:

   Alc.DestroyContext(AudioContext)


That was what I suspected, I just couldn't find the function (!?) to do it,
and thus I assumed it is done along with other destroy functions.


Jussi
--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user