100 Procedural Game Competition

Blitz3D Forums/Blitz3D Programming/100 Procedural Game Competition

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.

Damn.. I thought you could use streams as files. Well, you CAN but only for reading/writing operations, not for operations like PlaySound. Okay - I guess sound is harder than I thought. :) Created a wave okay, and dumped it into a memory bank, but can't yet see any way to play that without a) writing a file, or b) calling a library. Grr. :) Well - we could always cheat and put 16KB of "FF" in Data statements in our EXE, find the data in the EXE and then write from memory bank to that position to play a sound, and thus create no external files. ;) But meh..

Why oh why can't you play streams! That sux. :) Unless, you use TCP streams on 127.0.0.1 to make Blitz thinking its opening up a file on a location, meanwhile you're actually just feeding the stream from a memory bank. Hmmm..

/me goes to play around some more..

You *can* create chip sounds easily with Blitz.. its just PLAYING them without writing a file thats a pain. Grr :D

Sample sin wav function.. of course you have to write the wav header first of all, then its just a matter of math.
samples=44100
volume=900
frequency=400
For n = 1 To samples
divider=samples/frequency
sample=(Sin(2*Pi*n/divider) * volume)
WriteByte wave,sample
Next