reading float values from binary file

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
sshahriyari
Posts: 30
Joined: January 16th, 2017, 11:59 pm
Contact:

Hi all,
I have a binary file containing data recorded using a c program.
the data stored in files are float values.
Now I need  to retrieve the float numbers from binary file in after effects script
This is my code:

Code: Select all

var myFile = File.openDialog('select file');
myFile.open("r");
myFile.encoding = "binary";
for(x=0;x<myFile.length;x += 4){
     myFile.seek(x,0);
     buffer = myFile.read(4);
     ???
}
the question is how to convert the buffer to a float number
Post Reply