Android Question Reading & Writing integer (4bit) dat in wav file

BumForALiving

Member
Licensed User
Longtime User
Hello.

Using RandomAccessFile I seem to be having an issue reading and writing a 4 bit integer in a file, specifically wav format. I'm porting over a function I have to merge one or more wave files.

As an example, reading from offset 28 from the wav file I have:

BytesPerSec = file.ReadInt(28)

should return 176400 but instead I get 280035840

Also, writing to the two chunk locations, offset 4 & 40 with a 4 bit integer seem to work right sometimes and sometimes does not.

I'm thinking the stored integer data does not match what basic4android expects and not sure how to adjust.

Appreciate any help.
 
Top