Blitz (88/176)

From:John Mason
Date:24 Jul 2001 at 02:43:34
Subject:Re: offset

On Tue, 24 Jul 2001, amorel wrote:
> C=Looks right. Is there a pointerin the sound structure to the sound data?
> C=If so you could just copymem_ instead of using a for loop to copy the
> C=sample.
> Yes the first item of the sturcture is a pointer to the sound data. How silly
> I didn`t think of that, but oh well. You can read the sturctures of Blitz
> objects in the file "bb2objtypes.bb2" which I actually didn`t find out before
> too long ago, duh ;-)

Wow, first time I've heard that! :) That would have come in handy in that
past, many times. I don't seem to have that file though.

> I could just use the original data for stuff like displaying, which doesn`t
> change the data. But how would copymem_ work then and how would I read the
> sounddata?>
> Say I do this:
> *mysound.sound=addr xbsound(soundnr)
> *soundpointer.l=*mysound\_data
> How to access any byte of that data?

Something like this:

soundbyte.b = peek.b(*soundpointer+offset)

would get you the byte at that offset (0 being the first one obviously)...

If you wanted a copy of your own to play with though you'd need to do
something like:

dim soundcopy.b(soundsize)
copymem_ addr xbsound(soundnr), &soundcopy(0), size

Or, you could allocmem instead, but the array of bytes should work just as
well.

Hope this helps,



John Mason -- ICQ 17931257
http://chebucto.ns.ca/~ah210/Profile.html
Home of Wibby, NewStuff, and Reminder!

---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie