Wavesurfer.js: getting length of song?

Created on 21 Sep 2013  路  2Comments  路  Source: katspaugh/wavesurfer.js

I dont really see any methods to get the length of the song since i would like to make the size of my container change accordingly with the length of the song. Would be very helpful if there is a method to provide the length of the song i'm sure there is one internally somewhere thanks. :)

Most helpful comment

If you want your waveform to be it's own size and not fill the container, set the fillParent option to false and guess the right value for minPxPerSec so that waveforms are not too small (try 10 pixels per second).

Anyway, if you still want to get duration in seconds, use wavesurfer.backend.getDuration().

All 2 comments

If you want your waveform to be it's own size and not fill the container, set the fillParent option to false and guess the right value for minPxPerSec so that waveforms are not too small (try 10 pixels per second).

Anyway, if you still want to get duration in seconds, use wavesurfer.backend.getDuration().

thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joshsmith picture joshsmith  路  3Comments

asdfang picture asdfang  路  4Comments

ghost picture ghost  路  6Comments

thijstriemstra picture thijstriemstra  路  3Comments

sebhoff picture sebhoff  路  4Comments