Revision history for ExtLibal


Revision [17711]

Last edited on 2015-07-01 08:18:15 by DkLwikki [Updated in Git]
Additions:
Header version: openal-soft-1.16.0, freealut 1.1.0
Deletions:
Header version: ""OpenAL"" 1.13, ALUT 1.1.0


Revision [16863]

Edited on 2013-06-22 16:55:40 by DkLwikki [Remove outdated example, new one already at examples/sound/]
Deletions:
{{fbdoc item="ex"}}
{{fbdoc item="filename" value="examples/manual/libraries/openal.bas"}}%%(freebasic)
'' OpenAL-based .wav player example
#include "AL/al.bi"
#include "AL/alut.bi"
const SOUND_FILE = "test.wav"
'' Initialize OpenAL
alutInit(0, 0)
''
'' Load the .wav into an OpenAL buffer
''
dim as ALuint buffer
alGenBuffers(1, @buffer)
dim as ALenum wavFormat
dim as ALsizei wavSize
dim as ALsizei wavFreq
dim as any ptr wavData
dim as ALboolean wavLoop
alutLoadWAVFile(SOUND_FILE, @wavFormat, @wavData, @wavSize, @wavFreq, @wavLoop)
alBufferData(buffer, wavFormat, wavData, wavSize, wavFreq)
alutUnloadWAV(wavFormat, wavData, wavSize, wavFreq)
if (alGetError() <> AL_NO_ERROR) then
print "Error: Loading the .wav failed!"
end if
''
'' Setup sound sources -- each one can have a 3D position & velocity.
''
dim as ALuint source
alGenSources(1, @source)
dim as ALfloat SourcePos(0 to 2) = {0.0, 0.0, 0.0}
dim as ALfloat SourceVel(0 to 2) = {0.0, 0.0, 0.0}
alSourcei(source, AL_BUFFER, buffer)
alSourcef(source, AL_PITCH, 1.0)
alSourcef(source, AL_GAIN, 1.0)
alSourcefv(source, AL_POSITION, @SourcePos(0))
alSourcefv(source, AL_VELOCITY, @SourceVel(0))
''
'' Setup the listener's 3D position etc.
''
dim as ALfloat listener_position(0 to 2) = {0.0, 0.0, 0.0}
dim as ALfloat listener_velocity(0 to 2) = {0.0, 0.0, 0.0}
dim as ALfloat listener_orientation(0 to 5) = {0.0, 0.0, -1.0, _ '' look at
0.0, 0.0, 1.0} '' up vector
alListenerfv(AL_POSITION, @listener_position(0))
alListenerfv(AL_VELOCITY, @listener_velocity(0))
alListenerfv(AL_ORIENTATION, @listener_orientation(0))
''
'' Play the sound (change to AL_FALSE to disable looping)
''
alSourcei(source, AL_LOOPING, AL_TRUE)
alSourcePlay(source)
print "Sound is playing, press ESC to exit and anything else to pause..."
dim as string key
dim as integer active = -1
do
key = inkey()
if (len(key) > 0) then
if (key = chr(27)) then
exit do
end if
if (active) then
alSourcePause(source)
active = 0
else
alSourcePlay(source)
active = -1
end if
end if
loop
alSourceStop(source)
''
'' Clean up
''
alDeleteBuffers(1, @buffer)
alDeleteSources(1, @source)
alutExit()
%%


Revision [16777]

Edited on 2013-05-01 12:44:01 by DkLwikki [Update examples path]
Additions:
""OpenAL"" is a cross-platform 3D audio API appropriate for use with gaming applications and many other types of audio applications. ALUT is the ""OpenAL"" utility toolkit, a library providing additional functions to work with ""OpenAL"".
Header version: ""OpenAL"" 1.13, ALUT 1.1.0
Examples: in examples/sound/OpenAL/
Deletions:
OpenAL is a cross-platform 3D audio API appropriate for use with gaming applications and many other types of audio applications. ALUT is the OpenAL utility toolkit, a library providing additional functions to work with OpenAL.
Header version: OpenAL 1.13, ALUT 1.1.0


Revision [15917]

Edited on 2012-02-02 10:06:39 by DkLwikki [Add version]
Additions:
Headers to include: AL/al.bi, AL/alut.bi
Deletions:
Headers to include: ##AL/al.bi##, ##AL/alut.bi##


Revision [15911]

Edited on 2012-02-02 10:03:07 by DkLwikki [Add version]
Additions:
OpenAL is a cross-platform 3D audio API appropriate for use with gaming applications and many other types of audio applications. ALUT is the OpenAL utility toolkit, a library providing additional functions to work with OpenAL.
Headers to include: ##AL/al.bi##, ##AL/alut.bi##
Header version: OpenAL 1.13, ALUT 1.1.0
#include "AL/al.bi"
#include "AL/alut.bi"
Deletions:
OpenAL is a cross-platform 3D audio API appropriate for use with gaming applications and many other types of audio applications.
Headers to include: al/al.bi
#include "al/al.bi"
#include "al/alut.bi"


Revision [15425]

Edited on 2011-10-11 11:17:52 by CountingPine [Remove CamelCase link]
Additions:
Platforms supported: ""Win32"", Linux
Deletions:
Platforms supported: Win32, Linux


Revision [15359]

Edited on 2011-10-05 08:09:15 by DkLwikki [Add example]
Additions:
const SOUND_FILE = "test.wav"
alutLoadWAVFile(SOUND_FILE, @wavFormat, @wavData, @wavSize, @wavFreq, @wavLoop)
Deletions:
dim as string wavfile = command(1)
if (len(wavfile) = 0) then
print "Please pass a .wav file on the command line!"
end 1
alutLoadWAVFile(wavfile, @wavFormat, @wavData, @wavSize, @wavFreq, @wavLoop)


Revision [15356]

Edited on 2011-10-05 07:58:50 by DkLwikki [Add example]
Additions:
{{fbdoc item="ex"}}
{{fbdoc item="filename" value="examples/manual/libraries/openal.bas"}}%%(freebasic)
'' OpenAL-based .wav player example
#include "al/al.bi"
#include "al/alut.bi"
dim as string wavfile = command(1)
if (len(wavfile) = 0) then
print "Please pass a .wav file on the command line!"
end 1
end if
'' Initialize OpenAL
alutInit(0, 0)
''
'' Load the .wav into an OpenAL buffer
''
dim as ALuint buffer
alGenBuffers(1, @buffer)
dim as ALenum wavFormat
dim as ALsizei wavSize
dim as ALsizei wavFreq
dim as any ptr wavData
dim as ALboolean wavLoop
alutLoadWAVFile(wavfile, @wavFormat, @wavData, @wavSize, @wavFreq, @wavLoop)
alBufferData(buffer, wavFormat, wavData, wavSize, wavFreq)
alutUnloadWAV(wavFormat, wavData, wavSize, wavFreq)
if (alGetError() <> AL_NO_ERROR) then
print "Error: Loading the .wav failed!"
end if
''
'' Setup sound sources -- each one can have a 3D position & velocity.
''
dim as ALuint source
alGenSources(1, @source)
dim as ALfloat SourcePos(0 to 2) = {0.0, 0.0, 0.0}
dim as ALfloat SourceVel(0 to 2) = {0.0, 0.0, 0.0}
alSourcei(source, AL_BUFFER, buffer)
alSourcef(source, AL_PITCH, 1.0)
alSourcef(source, AL_GAIN, 1.0)
alSourcefv(source, AL_POSITION, @SourcePos(0))
alSourcefv(source, AL_VELOCITY, @SourceVel(0))
''
'' Setup the listener's 3D position etc.
''
dim as ALfloat listener_position(0 to 2) = {0.0, 0.0, 0.0}
dim as ALfloat listener_velocity(0 to 2) = {0.0, 0.0, 0.0}
dim as ALfloat listener_orientation(0 to 5) = {0.0, 0.0, -1.0, _ '' look at
0.0, 0.0, 1.0} '' up vector
alListenerfv(AL_POSITION, @listener_position(0))
alListenerfv(AL_VELOCITY, @listener_velocity(0))
alListenerfv(AL_ORIENTATION, @listener_orientation(0))
''
'' Play the sound (change to AL_FALSE to disable looping)
''
alSourcei(source, AL_LOOPING, AL_TRUE)
alSourcePlay(source)
print "Sound is playing, press ESC to exit and anything else to pause..."
dim as string key
dim as integer active = -1
do
key = inkey()
if (len(key) > 0) then
if (key = chr(27)) then
exit do
end if
if (active) then
alSourcePause(source)
active = 0
else
alSourcePlay(source)
active = -1
end if
end if
loop
alSourceStop(source)
''
'' Clean up
''
alDeleteBuffers(1, @buffer)
alDeleteSources(1, @source)
alutExit()
%%


Revision [10595]

The oldest known version of this page was created on 2007-08-03 22:48:50 by SirMud [Add example]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode