liamappelbe / wav

Dart package for reading and writing wav files
Apache License 2.0
18 stars 5 forks source link

[FEAT] Get duration from read(bytes) #4

Closed PcolBP closed 1 year ago

PcolBP commented 1 year ago

Is it possible to get duration of wav file?

gnudles commented 1 year ago

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)

liamappelbe commented 1 year ago

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

liamappelbe commented 1 year ago

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