Log on: Remember me
Powered by Elgg

timo :: Activity :: Just Me

People: Everyone | Friends & Community | Inbox | Just Me
Display: Full-text | Summary
Include: Blog Posts | Blog Comments | Files | Wiki Page | Wiki Comments

<< Back

Page 1 of 8

aggregated audio duration
timo | weblog | Sat Apr 17

I've finally written the one script that was missing from the interwebs and that I have longed to have for so long:

#!/usr/bin/perl
# Copyright (C) 2010 Timo Baumann
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License,
# or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.

use strict;
use warnings;
use Audio::Wav;
use Audio::Wav::Read;

#usage: audio-duration.pl path-or-file1 path-or-file2 ...

my @files;
for my $arg (@ARGV) {
    my $findresult = `find $arg`;
    push @files, grep /.wav$/, split " ", $findresult;
}
#print join " ", @files;
my $duration = 0.0;
my $wav = new Audio::Wav;
for my $file (@files) {
    my $read = $wav->read($file);
    $duration += $read->length_seconds();
}
# convert to something readable
my $readableDuration = "";
if ($duration > 600) {
    my $seconds = int($duration + .5);
    my $minutes = int($duration / 60);
    $seconds -= $minutes * 60;
    my $hours = int($minutes / 60);
    $minutes -= $hours * 60;
    $readableDuration = "(" . ($hours > 0 ? "$hours:" : "") . "$minutes'$seconds\") ";
}
print "$duration seconds ", $readableDuration, "in ", ($#files + 1), " wave files.\n";

Running this in any directory wil yield the duration of audio (only .wav files) of all the files in this directory. If you supply arguments, it will look into the given directories (or files) and tell you the summed duration.

A must-have for any corpus-linguist dealing with loads of audio files!

Update
timo | weblog | Sun Oct 11
I've been back from Stockholm for a while now, gone to Interspeech, SIGdial and YRRSDS and am now back at work in Golm. I'm now again (professionally) centered around two things: Getting our next prototype of an incremental SDS up and running in the next few months and continue to work on my PhD thesis, which I hope to finish some time next year.
Great new Sphinx Extensions
timo | weblog | Wed Jul 01
I finally got around to package the pitch tracker and some of our incremental result filtering (which was the reason for me travelling to Boulder, USA) as add-ons for Sphinx. Find them on my website.
Here and there
timo | weblog | Wed May 20
I have safely arrived in Stockholm, where I will be visiting researcher at KTH's speech lab for the summer. Also, I will be travelling to NAACL-HLT 2009 in Boulder to present our paper and a smaller workshop in Bielefeld. Also, I will participate in Dialholmia as a student volunteer. Many chances to meet and greet!
Speed-Up Boot under Ubuntu with VMware
timo | weblog | Fri Jan 30

I still need Windows for one piece of software that I use occasionally. So, since I've moved to Ubuntu, I've been using VMware for this (as it was the only solution at that time).

My VMware stopped working under Hardy. Luckily, I never needed my Windows-App for half a year. In Intrepid, I was able to just install vmware from their webpage and it restored my windows session from a year ago. Probably a record-breaking uptime for windows...

So, yesterday I played around with bootchart and found out, that the VMware-services took 4 precious seconds of my (and my battery's) lifetime on every boot. Not really worth it, as I'm unlikely to use my Windows-App anytime soon. So, here's what I did:

remove the links in /etc/rc*.d/*vmware

as the first command in /usr/bin/vmplayer add:

gksu -D "Need root priviledges to start vmware services." /etc/init.d/vmware restart

Works like a charm.

Generic Minimum Edit Distance of lists in Perl
timo | weblog | Tue Jan 20

The title says it all: I am looking for a generic implementation that tells me the edit distance of two lists. The implementations on CPAN all seem to work on string-data. Which is OK for finding typos but makes WER calculation tedious.

So, I want a generic implementation that takes a comparator-function (as in sort {$a <=> $b} @list) and two lists and outputs the edit distance. Nice to have would be distance-weights and really nifty if the value of the comparator function (not only !=0 but how much lower or higher) was taken into account.

Luckily I don't need it now, so I don't have to write it. But it would be a great finger exercise for a Perl-in-NLP class.

Literature Day ZWEI
timo | page | Sun Jul 20

vorläufige Terminvorschläge: 24. oder 28. Juli (Meinungen dazu bitte bis 21. Juli)

Literaturliste

  1. Mangu, Brill, Stolcke (2000): Finding consensus in speech recognition: word error minimization and other applications of confusion networks. [Timo, +]
  2. Wilson, Wilson (2006): An oscillator model of the timing of turn-taking. [David]
  3. was zu SDS-Architektur?
Literature Day ZWEI
timo | page | Mon Jul 14

vorläufige Terminvorschläge: 24. oder 28. Juli (Meinungen dazu bitte bis 21. Juli)

Literaturliste

  1. Mangu, Brill, Stolcke (2000): Finding consensus in speech recognition: word error minimization and other applications of confusion networks [Timo, +]
  2. Oszillator-im-Hirn-Kram [David]
  3. was zu SDS-Architektur?
Higgins
timo | page | Mon Jul 14

Higgins-Howto 

  • Mozart über Synaptic installieren:
    • mozart
    • mozart-gtk
    • mozart-stdlib
  • Higgins aus svn+ssh://helios/projekte/inpro/INPRO_SVN/Code/Higgins auschecken.
  • export HIGGINS_RUN=<pfad-zu-higgins> (am besten gleich in die .bashrc schreiben, dann weiß es jedes neu geöffnete terminal)
  • ozengine launcher/Launcher.exe applications/Numbers/numbers.higgins
  • von da aus die einzelnen Module starten (die Inspektoren gehen noch nicht)
  • für die Sphinx-Anbindung:
    • svn update in Eclipse (die Pakete heißen de.cocolab.inpro.higgins.*)
    • die sind jetzt veraltet, oder was?
    • TODO: Build-Pfad anpassen, noch irgendwas einbinden
  • voilà
Higgins
timo | page | Mon Jul 14

Higgins-Howto 

  • Mozart über Synaptic installieren:
    • mozart
    • mozart-gtk
    • mozart-stdlib
  • Higgins aus svn+ssh://helios/projekte/inpro/INPRO_SVN/Code/Higgins auschecken.
  • export HIGGINS_RUN=<pfad-zu-higgins> (am besten gleich in die .bashrc schreiben, dann weiß es jedes neu geöffnete terminal)
  • ozengine launcher/Launcher.exe applications/Numbers/numbers.higgins
  • von da aus die einzelnen Module starten (die Inspektoren gehen noch nicht)
  • für die Sphinx-Anbindung:
    • svn update in Eclipse (die Pakete heißen de.cocolab.inpro.higgins.*)
    • TODO: Build-Pfad anpassen, noch irgendwas einbinden
  • voilà
<< Back

Page 1 of 8