On Aug 23, 2006, at 11:50 AM, Norman Palardy wrote:


On Aug 23, 2006, at 1:10 AM, Patrick Cusack wrote:

I have a bunch of 24-bit audio files that are represented in two's complement format. I am analyzing the audio files.

1) Is there a way to grab 24 bit (3 integers) at a time instead of unrolling the data into a memoryblock a byte at a time? There are byte, short, long binarysteam.read methods, but nothing for 24 bits.

Sure ... read 1 long value with the offset such that you get the 3 bytes of interest
You may need to clear 1 byte then read the long

The first 24 bits would be handled special

        dim i as int32
        dim offset as integer
        
        if offset = 0 then
i = mb.byte(offset) * 256 * 256 + mb.byte(offset+1) * 256 + mb.byte(offset+2)
                offset = 2
        else
                mb.byte(offset) = 0
                i = mb.long(offset)
                offset = offset + 3
        end if

or something very close to this (coded in an email so it's only going to be close)

or i = Bitwise.BitAnd(mb.Long(offset), &00ffffff)

or maybe you could use ColorValue(offset, 24).

Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to