liamappelbe / wav

Dart package for reading and writing wav files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[FEAT] Get duration from read(bytes)

PcolBP opened this issue · comments

Is it possible to get duration of wav file?

Divide the total number of samples (of a single channel), by the sample-rate, and you will get the number of seconds. I also wrote such wav library for dart, a bit before this library, it is called wav_io, but unfortunately it did not got popular. (https://pub.dev/packages/wav_io)

Yeah, you can just divide the number of samples by the samples per second, but I should really add a helper method for this.

Done. Update to 1.2.0 and you'll see the duration method