{{newin|[[0.10.0]]|100|type=function}}
Gets the duration of the Source. For [[SourceType|streaming]] Sources it may not always be sample-accurate, and may return -1 if the duration cannot be determined at all.
== Function ==
=== Synopsis ===
<source lang="lua">
duration = Source:getDuration( unit )
</source>
=== Arguments ===
{{param|TimeUnit|unit ("seconds")|The time unit for the return value.}}
=== Returns ===
{{param|number|duration|The duration of the Source, or -1 if it cannot be determined.}}
== See Also ==
* [[Source:tell]]
* [[Source:seek]]
* [[parent::Source]]
* [[Decoder:getDuration]]
* [[SoundData:getDuration]]
[[Category:Functions]]
{{#set:Description=Gets the duration of the Source.}}
== Other Languages ==
{{i18n|Source:getDuration}}