Showing results for 
Search instead for 
Did you mean: 

Number of records in a waveform file

Go to solution

I am looking for a way to determine the number of records in a waveform file. I have looked through the waveform palette but can't find anything that seems to help. 


This is related to my Playing back a waveform thread but I thought I would start a new one to keep the question and answers separate. 


In general I want to use a horizontal slider to move between records in the waveform file. So the user can pause playback, move to a new starting point and resume playback. To do this I need to know how many records are in the file so I can set the maximum record number on the slider.


So far I have come up with this:


But I really think there has to be a better way...

Unfortunately, most readers of this Forum, including some real Experts, have not mastered the skill of being able to read the code that Posters fail to post. If we cannot see "what you did wrong", we are unable to tell you how to fix it. (Bob Schor 28 August 2018)
0 Kudos
Message 1 of 3
Accepted by topic author RTSLVU
03-25-2019 03:15 PM

Try something like this.




If I remember correctly these are datalog files with 1d array of waveform as the record type.





Message 2 of 3

I was about to suggest something similar, but as my knowledge base is less than 57005's, my approach is "experimental".  Read one record, figure out its size in bytes (you could "brute force" it with a typecast to array of u8), get the size (in bytes) of the file, and divide ... .


Bob Schor

Message 3 of 3