Generate and load sound from memory bank, no HDD

Blitz3D Forums/Blitz3D Programming/Generate and load sound from memory bank, no HDD

LamptonWorm(Posted 2011) [#1]
Hi all,

I'm trying to find out if it's possible to create a bank, fill it with the data that makes up a WAV (including header etc) then use "LoadSound" on that bank to load in and use the sound.

I read that it isn't possibly and you had to write a .WAV to HDD then load that in. I'd like to avoid any writing to HDD but still want to generate sounds..thoughts welcome!

Cheers,
LW.


Rroff(Posted 2011) [#2]
One of the features I've always wanted to see in B3D is the ability to load any file from a bank, including sounds. Unfortunatly afaik short of writing your own virtual device driver/filesystem or hooking into B3D at runtime to filter its file commands theres no way to do this and neither of those options are easy.

Last edited 2011


RifRaf(Posted 2011) [#3]
write your own wav loader and use somthing like the code i posted here in your loader instead of normal file commands

http://www.blitzbasic.com/codearcs/codearcs.php?code=2412#comments


LamptonWorm(Posted 2011) [#4]
Thanks for the reply.

I think as a half way house I'll end up writing the raw data from an array to a wave file, load the wave to memory, and delete the file from disk.

If there are any other ideas and options around generating and playing sounds without using external files I'd like to hear them.

(edit, I posted before seeing the link above, I'll have a look!)

Cheers,
LW.

Last edited 2011

Last edited 2011


Warner(Posted 2011) [#5]
You could look into BlitzBass. It is more flexible than Blitz3d's native sound system: http://www.blitzbasic.com/toolbox/toolbox.php?tool=207


Rroff(Posted 2011) [#6]
Guess you could write a wrapper to one of the openAL libs - quite a bit of work but I believe they can take raw wave data as an input and a lot more sound options than native b3d.

Quite a bit of work tho - I started on it once and gave up - but a lot more straight forward than device drivers or hooking b3d.

Last edited 2011


LamptonWorm(Posted 2011) [#7]
Thanks for the ideas - Bass is a good shout also, I'll have a look into that.

Not sure I want to get tangled up in writing my own loader/wrapper to be honest.

(edit: bass.. BASS_CreateBeep, awesome!)

Cheers,
LW.

Last edited 2011