Casting.

Blitz3D Forums/Blitz3D Programming/Casting.

Colvette(Posted 2005) [#1]
Is there anyway to cast types to different types in Blitz?

As in, if I read a sound file into a memory buffer (Bank), how can I get that played through "PlaySound"?

Thanks in advance for any suggestions!


big10p(Posted 2005) [#2]
This can't be done natively in blitz. Handles in blitz aren't simple pointers to the raw data, for starters.

You may be able to cobble together some kind of memory hack using a DLL, but that's just dirty. :)


Colvette(Posted 2005) [#3]
Gah! Soooo don't understand how to use the DLL stuff!! :(


big10p(Posted 2005) [#4]
Maybe if you say why you want to be able to do this kind of stuff, we can suggest alternative methods.

For example, if you want to load sound data into a bank to alter it, you can, then just save the data back out to a sound file and load and play it in the usual way.


Colvette(Posted 2005) [#5]
I need live control over the position of the sound to be played back. I also need to be able to play the sound in reverse at different pitches etc.

The ChannelPitch stuff doesn't seem to work properly in reverse - doesn't play the entire sample.