Skip to content

Commit

Permalink
add duration output
Browse files Browse the repository at this point in the history
  • Loading branch information
imskull committed Dec 13, 2013
1 parent e5763fb commit b6b168c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Binary file modified bin/Darwin/wav2json
Binary file not shown.
5 changes: 5 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ int main(int argc, char* argv[])
// open sound file
SndfileHandle wav(options.input_file_name.c_str());

// output sound duration
if (i == 0) {
ofs << " \"duration\":" << wav.frames()/wav.samplerate() << "," << std::endl;
}

// handle error
if ( wav.error() )
{
Expand Down

0 comments on commit b6b168c

Please sign in to comment.