sfx with bass

BlitzMax Modules Forums/Brucey's Modules/sfx with bass

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.

so something like this would be ok?

SuperStrict

Import BaH.Bass
Import brl.GLMax2D

Incbin "LockNLoad4.wav"

If Not TBass.Init(- 1, 44100, 0, Null, Null) Then
	DebugLog "Can't initialize device : " + TBass.ErrorGetCode()
	End
End If

Local stream:TBassChannel = New TBassStream.CreateMem(IncbinPtr("LockNLoad4.wav"), IncbinLen("LockNLoad4.wav"), 0)

If Not stream.Play(False) Then
		DebugLog "can't play... : "  + TBass.ErrorGetCode()
	Else
	
	Graphics 640, 480, 0
	
	
		For Local i:Int = 0 To 100
			
			stream:TBassChannel = New TBassStream.CreateMem(IncbinPtr("LockNLoad4.wav"), IncbinLen("LockNLoad4.wav"), 0)
			stream.Play(False)
			
			DrawText i, 10, 10
			Flip; Cls
			Delay 50
		next
	
	
End If

EndGraphics()

TBass.Free()

End


only i'd probably have a pool of channels.

Cheers
Charlie