OpenAL 3DSound Module

BlitzMax Modules Forums/MiniB3D/OpenAL 3DSound Module

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Klepto,
It works great on my
Audio3D SB Audigy 2 ZS Audio [8800]

excellent work!

here is another tiny sample. gives a bird's eye view of the "Listener"

EDIT: I have "Audio3D SB Audigy 2 ZS Audio [8800]" with 7.1 speakers.
EDIT: added runtimeerror if AL not installed.


Import sidesign.minib3d
Import sidesign.minisound3d

If Not OpenALInstalled() 
     OpenURL("http://www.openal.org/downloads.html")     
     runtimeerror "OpenAL is not installed on this system, "     
     
endif


Local URL:String="http::www.bmaxbook.com/guitar.ogg"
Global SoundBank:TBank=LoadBank(URL)


Graphics3D 800 , 600 , 0 


Local Drives:String[] = Audio3dDrives()
For Local Drive:String = EachIn Drives
	Print Drive
Next

SetAudio3DDriver(Drives[3])

Local Cam:TCamera = CreateCamera()
Local Listener:Tentity = CreateSphere()
EntityColor Listener,0,100,0


Local Light:TLight = CreateLight()

Local cube:TMesh = CreateCube()
PositionEntity(cube , 0 , 0 , 10)
EntityColor cube,255,0,0
MoveEntity cam,0,10,20 		' this is 180 degrees
PointEntity cam, Listener
Local Sound:T3DSound = TSound3D.LoadSound(SoundBank )


CameraClsColor(Cam,20,20,20)
Local time:Float = 0
CreateListener(Listener)


While Not KeyHit(Key_Escape)
		
	'PointEntity Cam , Cube

	Local Z:Float = -Sin(Time)* radius
	Local X:Float = Cos(Time) * radius
	time:+.25
	radius = 10
	PositionEntity cube,x,0,z
	'TurnEntity(Cam,0,0.5,0)
		
	If KeyHit(KEY_SPACE) Then EmitSound(Sound,Cube)
	
	RenderWorld()
	
		
	Flip
Wend