natiny.clip.get_duration

Lua
natiny.clip.get_duration(clip) -> seconds

Returns how long a clip is, in seconds.

Parameters

Name Type Description
clip number Clip handle

Returns

Type Description
number Length in seconds, or 0.0 for an invalid clip

Example

Lua
local seconds = natiny.clip.get_duration(clip)

Notes

  • The length of the recording, not of a playback: a source pitched away from 1.0 takes correspondingly more or less time to get through it.
  • Invalid and destroyed handles return 0.