Get time from sample number...

A command that becomes available in the Query menu if you select a Sound or LongSound object.

The Info window will tell you the time (in seconds) associated with the sample number that you specify.

Setting

Sample number
the sample number whose time is sought.

Algorithm

the result is

t1 + (sample_number - 1) · Δt

where t1 is the time associated with the first sample, and Δt is the sampling period.

Details for hackers

If you select a Sound or LongSound and click Inspect, you can see how the relation between sample numbers and times is stored in the object: t1 is the x1 attribute, and Δt is the dx attribute.


© ppgb, April 20, 2004