Ticket #705: voice2dbus.pl

File voice2dbus.pl, 337 bytes (added by tegzed, 9 years ago)

simple tool to filter pocketsphinx output and forward recognized text to navit via dbus interface

Line 
1#!/usr/bin/perl
2
3while(<>) {
4  $line = $_;
5  if($line =~ /^0000\d+?\:(.*)\(/ ) {
6    $words = $1;
7    if($line !~ /^\s*$/) {
8      print "SEND $words\n";
9      system "dbus-send --print-reply --dest=org.navit_project.navit /org/navit_project/navit/default_navit org.navit_project.navit.navit.add_voice_data string:'$words'"
10    }
11  }
12}
13