reorginization and new sound format

This commit is contained in:
MathMan05
2024-11-30 22:47:50 -06:00
parent 7c46e70304
commit 6788c54ad6
12 changed files with 595 additions and 186 deletions

View File

@@ -20,6 +20,11 @@ class BinRead{
readString16(){
return this.readStringNo(this.read16());
}
readFloat32(){
const float = this.view.getFloat32(this.i);
this.i += 4;
return float;
}
readStringNo(length: number){
const array = new Uint8Array(length);
for(let i = 0; i < length; i++){
@@ -38,6 +43,10 @@ class BinWrite{
this.buffer=new ArrayBuffer(maxSize);
this.view=new DataView(this.buffer, 0);
}
write32Float(numb:number){
this.view.setFloat32(this.i,numb);
this.i+=4;
}
write16(numb:number){
this.view.setUint16(this.i,numb);
this.i+=2;