Music Visualizations

Blitz3D Forums/Blitz3D Programming/Music Visualizations

Hey anyone know how i can sync music and visual effects in a game?

Hmm, there seems to be a module called BlitzBass, which can extend the sound-playing caps of b3d. However, I never tried it.
A very basic method for (time-based) syncing is this:

	Graphics 320, 240, 0, 2
	SetBuffer BackBuffer()
	
	;load and play sound
	s = LoadSound("d:\kch\onair.mp3")
	chn = PlaySound (s)
	
	;wait for sound to start
	While Not(ChannelPlaying(chn))
		Delay 1
	Wend
	
	;reset timer
	start = MilliSecs()
	
	;draw timer while sound is playing
	While ChannelPlaying(chn)
	
		Cls
		Locate 0, 0 
		tme = ((MilliSecs() - start) / 1000)
		Print tme
			
		Flip
		
		If KeyHit(1) Then Exit
		
	Wend
	
	End


Yes using BASS is the way to go, see here - check out the spectrum analyser...

http://www.boiledsweets.com/techdemos