PIONEERS Exploring Speech to Text

Aaron D. Vail

New Member
Joined
May 27, 2013
Messages
6
Reaction score
0
Sorry to hear about the crash. what is really sad is if I did the project a month ago I would still have it :D I will search the PDF and see what I can find. I will post my findings so that it maybe available to others (assuming I find it) or whether or not I'll need someone to help me again (saying I don't find it)
 

Cam__

Member
Joined
May 22, 2013
Messages
43
Reaction score
8
There are options for recovering lost content. If you can structure a Google search such that the result lists the missing post, you may still be able to get it from Google's search cache. There is also the possibility it may be readable in the monster PDF file (link someone?).

Unfortunately that monster file doesn't help much, because all paragraphs are truncated after the first line, and even code blocks with long lines get truncated. Also, a couple of times I have searched that file for something I knew should be in there yet the search turned up empty. :(
 

Aaron D. Vail

New Member
Joined
May 27, 2013
Messages
6
Reaction score
0
My Original Post ....

OK. Let me start by saying I know very little about PERL. I followed the steps in POST #1 and POST #8. Running on my PAIF 2.0.6.2, POST #1 works as advertised, but POST #8 doesn't appear to be working. At least I'm not getting any output from the script, other that it's openning the file. What brought me to this thread was searching for a good speech to text script. That being said, I currently have a PERL script that converts the wav file to and mp3 and emails the mp3 instead.

Code:
    #!/usr/bin/perl
    open(VOICEMAIL,"|/usr/sbin/sendmail -t");
    open(LAMEDEC,"|/usr/bin/dos2unix|/usr/bin/base64 -di|/usr/bin/lame --quiet --preset voice - /var/spool/asterisk/tmp/vmout.$$.mp3");
    open(VM,">/var/spool/asterisk/tmp/vmout.debug.txt");
    my $inaudio = 0;
    loop: while(<>){
      if(/^\.$/){
        last loop;
      }
      if(/^Content-Type: audio\/x-wav/i){
        $inaudio = 1;
      }
      if($inaudio){
        while(s/^(Content-.*)wav(.*)$/$1mp3$2/gi){}
        if(/^\n$/){
          iloop: while(<>){
            print LAMEDEC $_;
            if(/^\n$/){
              last iloop;
            }
          }
          close(LAMEDEC);
          print VOICEMAIL "\n";
          print VM "\n";
          open(B64,"/usr/bin/base64 /var/spool/asterisk/tmp/vmout.$$.mp3|");
          while(<B64>){
            print VOICEMAIL $_;
        print VM $_; 
          }
          close(B64);
          print VOICEMAIL "\n";
          print VM "\n";
          $inaudio = 0;
        }
      }
      print VOICEMAIL $_;
      print VM $_;
    }
    print VOICEMAIL "\.";
    print VM "\.";
    close(VOICEMAIL);
    close(VM);
   
    #CLEAN UP THE TEMP FILES CREATED
    #This has to be done in a separate cron type job
    #because unlinking at the end of this script is too fast,
    #the message has not even gotten piped to send mail yet


If someone could modify this script to insert the output of speech-recog-cli.pl into vmout.debug.txt (i think before the mp3 is attached) that should resolve number of requests getting transcripts into voicemail.
 

Aaron D. Vail

New Member
Joined
May 27, 2013
Messages
6
Reaction score
0
The Reply that fixed it. Posted by Delta End

NOTE: Google has, as of 1/11/2013, turned this down from 30 seconds to 15 seconds.

1. Log into your server via SSH as root and... (remove w-g-e-t hyphens!)
Code:
    cd /root
    wget -N http://www.deltaend.net/pbx/installmp3stt.sh
    chmod 0755 installmp3stt.sh
    ./installmp3stt.sh
2. In FreePBX, choose Settings -> Voicemail Admin -> Settings, make the following changes, then click Submit and Reload FreePBX.
Code:
    format  -> wav
    mailcmd -> /usr/sbin/sendmailmp3
3. Leave yourself a voicemail and you should see the first 30 seconds of the voicemail transcribed for you.

; WARNING:
; If you change the list of formats that you record voicemail in
; when you have mailboxes that contain messages, you _MUST_ absolutely
; manually go through those mailboxes and convert/delete/add the
; the message files so that they appear to have been stored using
; your new format list. If you don't do this, very unpleasant
; things may happen to your users while they are retrieving and
; manipulating their voicemail.

--Notes:
sendmailmp3
Version 1.4G - Initial release
Version 1.4G1 - Made script more robust with more error checking and retry attempts.
Version 1.5G - Script now enhances the original MP3 script by fixing the pager/cell message bug that prevented short voicemail notifications from being sent. Also changed some lines around to try to help with Pi users.

installmp3stt.sh
Version 1.0 - Initial release
Version 2.0 - Added dependency installer and full support for Pi.

--Credits to:

N. Bernaerts for a top notch MP3 conversion script
Lefteris Zafiris for his top notch AGI script which does the Google STT calls
Google (we love you!) --EDIT-- We love you less now that you reduced your STT limit from 30 seconds to 15 seconds. Why Google why? Give us a proper STT API for pity sake.
Everyone who helped run down bugs and test the code, especially AndyInnYC with Pi testing.
Warmundy for introductions to the original code.
 

krzykat

Telecom Strategist
Joined
Aug 2, 2008
Messages
3,145
Reaction score
1,235
For those who want to experiment with a speech to e-mail (text) application for your own personal use, you might try dropping something like this into extensions_custom.conf. I am only posting this as an example of what might work, and because of darmock's comment I'm specifically NOT saying anyone should actually try this. If you do try it then it's at your own risk (including any legal risks):

How long of a "speech" can be used for this? I have heard contrasting details about the length of speech->text that google allows per instance.
 

Members online

No members online now.

Forum statistics

Threads
25,782
Messages
167,509
Members
19,202
Latest member
pbxnewguy
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top