Last updated 26 April 2013. Created on 21 March 2013.
Edited by densolis. Log in to edit this page.

Installation

Introduction

Our goal with this documentation is to provide you with easy to follow, step by step installation instructions. If we have missed something or if something is not clearly explained, please let us know. You can either edit this document directly or you can submit an issue to the WebSpeech Issue Queue. If you do submit an issue, please choose the "Installation" Issue Component. This will help me respond to your installation issue in a more timely manner.

To install and configure Web Speech you will need to install one library and two modules.

Library needed:

Modules needed:

Note:Please do not confuse the Libraries API module with the Drupal sub-directory "../sites/all/libraries". There are two very different items.


Library Installation Instructions

Download and install the Web Speech library. NOTE: This library is NOT available from Drupla.org. Instead, you will need download the Web Speech library from http://sourceforge.net/projects/e-guidedog/files/WebSpeech. When you click on the link, a page similar to the below page should appear:

Screen shot of WebSpeech Library Download Page

You should download the latest library, which at the time of this writing is WebSpeech-4.0.1. The library is stored as both a "zip" and a tar ball (.tar.bz2). Normally, the zip file is used by Windows while the tar ball is used by Apple and Linux. However, you can use a tar ball on Windows if you download additional software such as 7-Unzip.

If you need additional instructions for downloading and un-compressing a “tar ball”, you might want to read these posting:

Once the Web Speech library is download, you should place the uncompressed WebSpeech library into the sub-directory “…/sites/all/libraries/WebSpeech”. The file WebSpeech.js must be in the sub-directory “…/sites/all/libraries/WebSpeech”. If it is not, you will receive an error message from the WebSpeech Drupal module.

NOTE: While the capital letters in the name WebSpeech are not important on a Windows platform, they are critical on a Linux platform. So please name your directory correctly, especially if you plan to migrate it to a remove server, which probably be running Linux.


Module Installation Instructions

Libraries API Module

  • Download the Libraries API module from Drupal.Org
  • Place the uncompressed Libraries module folder into your ...sites/all/modules or ...sites/all/modules/contrib directory. Alternatively, you can can also use drush or the Drupal interface to install this module (yoursite/admin/modules).
  • Enable this module by either going to Admin > Site Building > Modules and enable the Libraries module or using the drush command “drush en libraries”

WebSpeech

  • At the time of this writing, the WebSpeech module is still a sandbox project. As such, the instructions for installing a sandbox project module is different from installing a "normal" Drupal module. You will need to downloaded and install the web speech module using a git.

    NOTE: The below git command will download / clone the software into a sub-directory call "webspeech" (hence the "webspeech" at the end of the git command). Therefore it is critical that you are in the proper directory when you issue the below command. Therefore, before you issue the below git command, you will need to navigate to the ".../sites/all/modules" or ".../sites/all/modules/contrib" directory on your development site.

    Once you are in the appropriate directory, you can issued the git command. (The current git command can be found on hgneng’s sandbox page.) At the time of this writing, the git command was:

    git clone http://git.drupal.org/sandbox/hgneng/1932690.git webspeech

  • Enable this module by either going to Admin > Site Building > Modules and enable the WebSpeech module or using the drush command “drush en webspeech”


Enable the Web Speech Control Block

When Web Speech is installed on a page, two buttons will appear on the page. These buttons are:

  • Read Content
  • Stop


  • To make these buttons appear on a page, you must enable the Web Speech Control Block. You can do this by going to Home -> Administration -> Structure -> Blocks and looking for the block named “WebSpeech Controler”. This block will be in the disabled blocked section of this page. You will need to change the block's Region from “None” to the desired region on the page. You might want to start with the Content region.

    Once the WebSpeech Controler block is enable, the button that appear on your page should look something like:

    Web Speech Read and Stop buttons

    If you do not see the above buttons on the desired page or in the specified block, then something was not done correctly.

    Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

    Comments

    Tony-Mac’s picture

    Except for a few typos the instructions are concise and well written. I had no trouble getting this to work.
    Thanks for your dedication.
    Tony

    cdykstra’s picture

    thanks!

    kodolka’s picture

    I installed everything but buttons do not work.

    tapas_talukder’s picture

    Some days before webspeech work fine, but now that is not working.

    Mainly the URL http://wa.eguidedog.net/cgi-bin/ekho.pl is not accessible or not working.

    Can any only tell me whether the URL changed or the service has terminated?

    walii’s picture

    1 : Download and install Espeak from http://espeak.sourceforge.net/download.html
    2: Install LAME from http://lame.buanzo.org/
    write a web script to handle request

    if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
      define('ESPEAK', 'C:\xampp\htdocs\eSpeak\command_line\espeak');
      define('LAME', 'C:\xampp\htdocs\eSpeak\command_line\lame');
    } else {
      define('ESPEAK', '/usr/bin/espeak');
      define('LAME', '/usr/bin/lame');
    }
      $text = $_GET['text'];
    if (isset($_GET['voice'])) {
      $voice = $_GET['voice'];
    } else {
      $voice = 'en';
    }
    if (isset($_GET['speedDelta'])) {
      $speed_delta = $_GET['speedDelta'];
    } else {
      $speed_delta = 0;
    }
      $speed = (int)(175 + 175 * $speed_delta / 100);
    if (isset($_GET['pitchDelta'])) {
      $pitch_delta = $_GET['pitchDelta'];
    } else {
      $pitch_delta = 0;
    }
      $pitch = (int)(50 + $pitch_delta / 2);
    if (isset($_GET['volumeDelta'])) {
      $volume_delta = $_GET['volumeDelta'];
    } else {
      $volume_delta = 0;
    }
      $volume = (int)(100 + $volume_delta);
      $filename = md5($text) . '.mp3';
     
     $filepath =  'voicesmp3/v' . $voice . 's' . $speed . 'p' . $pitch . 'a' . $volume . 't' . $filename;
      $text = escapeshellarg($text);
    if (!file_exists($filepath)) {
      $cmd = ESPEAK." -s $speed -p $pitch -a $volume --stdout $text | ".LAME." --preset voice -q 9 --vbr-new - $filepath";
       exec($cmd); 
      }  
      header('Content-Type: audio/mpeg');
      header('Content-Length: ' . filesize($filepath));
      readfile($filepath);
    

    NOTE : first you install espeak in xamp htdocs

    In my case xamp in c drive after installing espeak you show a folder in htdocs folder name is eSpeak

    In espeak folder you see a folder name command_line and lame is install in command_line folder

    You make a folder in htdocs name is testespeak
    In testespeak you put a php file name is test.php
    And put the above code in test.php
    Also make a folder Name "voicesmp3" in testespeak ih which folder all text mp3 audio is show