Listen with openAL

BlitzMax Forums/BlitzMax Programming/Listen with openAL

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.

Just knocked this up for ya (not tested). I used a short pointer instead of peekshort...
Method isSound16Bit%(samplesbank:TBank)
	Local sptr:Short Ptr = Short Ptr(BankBuf(samplesbank))
	For Local i% = 0 Until BankSize(samplesbank)/BytesPerSample[format] Step 8
		If Abs(SignedShort(sptr[i]))>15 Then Return True
	Next
	Return False
End Method

Notice the divide ;)

As for saving to ogg vorbis There is a SaveOgg command ready to use.