amsehili / auditok

An audio/acoustic activity detection and audio segmentation tool
MIT License
749 stars 96 forks source link

Keyword {duration} returns error #7

Closed jhoelzl closed 8 years ago

jhoelzl commented 8 years ago

Hello, beside {id}, {start} and {end}, i also want to use the keyword {duration}.

However, when using it, i get following error:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/myproject/venv/local/lib/python2.7/site-packages/auditok/cmdline.py", line 524, in run
    end = self.time_formatter(end_time)))
KeyError: 'duration'

Regards, Josef

amsehili commented 8 years ago

Hi Josef,

Can you paste the whole command you that yielded this output.

Also, can you put the output of auditok --version.

Thanks, A

jhoelzl commented 8 years ago

I tried this command

auditok -e 55 --printf "{start} {duration} {end} -i input.wav -O output.wav"

I found the duration tag somewhere in the code, but it is not documented in README.md.

amsehili commented 8 years ago

You're probably not using the latest version on github (0.1.6).

pip-installed versions do not include {duration} keyword, and you're right it's not yet documented. A new keyword for audio events' time-stamp (i.e. system's time, as required by some users) should be added as soon as possible with an up-o-date documentation.

So, back to this {duration} issue, I'd suggest that you remove your installed version and install the one on github:

sudo pip uninstall auditok
git clone https://github.com/amsehili/auditok.git
cd auditok
sudo python setup.py install

Cheers

jhoelzl commented 8 years ago

@amsehili thanks, it works fine with the latest version 0.1.6, i was using the version 0.1.5 from pip.