Mercurial > hg > auditok
changeset 4:31c97510b16b
README.md, demos/audio_trim_demo.py updated
author | Amine Sehili <amine.sehili@gmail.com> |
---|---|
date | Tue, 22 Sep 2015 11:12:11 +0200 |
parents | 364eeb8e8bd2 |
children | 252d698ae642 78fae88dd98f |
files | README.md demos/audio_trim_demo.py |
diffstat | 2 files changed, 13 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/README.md Tue Sep 22 10:49:57 2015 +0200 +++ b/README.md Tue Sep 22 11:12:11 2015 +0200 @@ -1,7 +1,7 @@ AUDIo TOKenizer =============== -`auditok` is an Audio Activity Detection library that wan be used with online data (i.e. microphone) or with audio files. +`auditok` is an **Audio Activity Detection** library that can be used with online data (i.e. microphone) or with audio files. Requirements ------------ @@ -10,7 +10,7 @@ Installation ------------ - pip install auditok + python setup.py install Demos ----- @@ -22,7 +22,15 @@ python demos/echo.py 50 15 - If only one argument is given it will be used for energy. Other demos are in /demos. + If only one argument is given it will be used for energy. + +Try out this demo with an audio file (no argument is required): + + python demos/audio_tokenize_demo.py + +Finally, this in this demo `auditok` is used to remove tailing and leading silence from an audio file: + + python demos/audio_trim_demo.py Documentation ------------- @@ -40,4 +48,3 @@ Author ------ Amine Sehili (<amine.sehili@gmail.com>) -
--- a/demos/audio_trim_demo.py Tue Sep 22 10:49:57 2015 +0200 +++ b/demos/audio_trim_demo.py Tue Sep 22 11:12:11 2015 +0200 @@ -67,9 +67,9 @@ validator = AudioEnergyValidator(sample_width=asource.get_sample_width(), energy_threshold=50) # Create a tokenizer with an unlimited token length and continuous silence within a token -# Note the DROP_TRAILING_SILENCE mode that will ensure removing tailing silence +# Note the DROP_TAILING_SILENCE mode that will ensure removing tailing silence trimmer = StreamTokenizer(validator, min_length = 20, max_length=99999999, - max_continuous_silence=9999999, mode=StreamTokenizer.DROP_TRAILING_SILENCE, init_min=3, init_max_silence=1) + max_continuous_silence=9999999, mode=StreamTokenizer.DROP_TAILING_SILENCE, init_min=3, init_max_silence=1) tokens = trimmer.tokenize(asource)