Voice recording applets SDK, v.1.1

 

1.Introduction.

2. Applets functionality.

3. Voice Recording Applet SDK package consist of:

4. The JavaScript interface:

-        the list of the recording applet methods,

       -     the list of the voice streaming applet methods.

5. Installation:

      -      for Unix server,

-        for IIS.

6. Troubleshooting.

7. Appendix A.

 

 

Introduction

 

The voice recording applets SDK is designed for the web developers and allows to record the voice from web site, to compress it and to send to the web server via HTTP. To playback the recorded voice from the server the embedded voice streaming player or a separate player as a voice streaming applet can be used.  Both applets are designed in Java 1.1 and have a JavaScript interface. User can customize the JavaScript code correspondingly to your scenario.

 

Applets functionality

 

a)  the voice recording applet functionality :

1.            Voice capture from sound card. The sampling frequency is 8000Hz.

2.            Voice compression to 4800bps ( 36K per minute).

3.            Playback of compressed voice file from client computer for sound quality and content evaluation.

4.            Sending of voice file to web server via HTTP.

5.            Playback  the voice files from web server.

 

b)  the voice streaming applet functionality:

1.     Playback  the voice files from web server.

 

The voice recording and voice streaming applet is developed in Java 1.1. So, the client does not need to install a big size Java 1.3 plug-in or upgrade a Java Virtual Machine (JVM) ( i.e. applets work on the target browsers with default browser JVM installation).  The recording applet uses native methods for sound capture. They are developed in C++ and implemented as dll. The dll will be installed on the client computer if the applet is being used for the first time.  The recording applet is digitally signed.

For receiving of the voice files from a recording applet, the CGI-program runs on the server.

 

Target OS Platform: Windows  98/NT/2000/ME/XP.

Target browsers: Microsoft Internet Explorer 4.0 and up, Netscape 7.

Web Servers: Unix, IIS.

Demo version works under IE and allows to record 20 sec only.

 

Voice Recording Applet SDK package consists of:

 

1.     Voice recording applet.

2.     Voice streaming applet.

3.     Sound capture dll.

4.      Server programs.

5.      Examples.

6.     Documentation.

 

 

The JavaScript interface

 

The JavaScript interface allows to customize the applets to your web site scenario and style. It allows to design the own buttons and to send the names of files for recording and playback from JavaScript to applets. Also, applet send the status message and duration of record to JavaScript.

 

 

The table of the recording applet methods:

 

Accessible applet methods from JavaScript

Applet action

RECORD_RP(  )

Starts the recording/compression of audio data

PLAYBACK_RP (  )

Starts the playback from client PC

PAUSE_RP (  )

Playback pause

STOP_RP (  )

Stop the record or playback

UPLOAD_RP (  String filename )

Uploads voice file from client PC to web server.

Server script program responsible for file receiving

WEBPLAY_RP ( String filename )

Playback the recorded voice file from the server.

Accessible JavaScript methods from applet

 

SetStatus_RP( s )

Applet sends status message to JavaScript

SetTimer_RP( s )

Applet sends current recording/playback time to JavaScript

confirmRecord(s)

Confirm re-recording

addName(s)

Adds voice file name to list of files for listening from web server.

 

 

 

The table of the voice streaming applet methods:

 

Accessible applet methods from JavaScript

Applet action

PLAYBACK_P(String filename )

Starts the playback from client PC

PAUSE_P(  )

Playback pause

STOP_P(  )

Stop the playback

Accessible JavaScript methods from applet

 

report_P(s)

Pop-up message

setStatus_P(s)

Applet sends status message to JavaScript

setTimer_P(s)

Applet sends current recording/playback time to JavaScript

 

 

 

Installation

1.  for Unix server:

 

1.1. Create on the server the directory   /voicefiles  and /recorder relatively of the DocumentRoot virtual domen (root of the server). For example:

www.vimas.com

 

voicefiles

 
 

 

 

 

 

 

recorder

 
 

 

 

 

    In the /voicefiles directory the recorded voice files will be stored.

 

1.2. Put into /recorder direcory the following files:

-             RPApplet4800.cab, RPApplet4800.jar – recording applet,

-             jaudio4800.tar – voice capture dll,

-             VPlayerSDK4800.cab, VPlayerSDK4800.jar – voice streaming applet,

 

1.3.  rec_app.html – is example of using recording applet, play_app.html is example of using playback applet.

      Put the rec_app.html, play_app.html  into the directory where your *.html files are stored. Change in the rec_app.html, play_app.html examples the VIMAS Technologies web server URL  www.vimas.com to your URL.

 

 

1.4.Put to the cgi-bin directory the retrive.pl file.

 

1.5. Modificate, if it is necessary, the path in the 1st ,3rd ,  4th and 5th  lines of retrive.pl source code.

-      in the 1st line indicate the path where Perl is placed.

-      In the 3rd line indicate path for .log file.

-      In the 4th line indicate the full path of the /voicefiles directory.

 

1.6. Set the permission for the retrive.pl CGI-program.  Use  chmod 755 retrieve.pl  instruction 

    (web server administrator can do it).

 

1.7.In the applet parameters:

         a) <PARAM NAME = "TimeLimit"                    VALUE = "20">

the maximal recording time (in sec.) is determined. Value range is 1....3599 sec.

In the demo version the  20 sec. limitation is used independently from TimeLimit value.

        b) In the    <PARAM NAME = "BgColor"                                   VALUE = "000000">  

set the background color of web page.

 

 

2. for IIS:

 

2.1.  Create on the server the /Inetpub/wwwroot/voicefiles  and  /Inetpub/wwwroot/recorder directories.

 


2.2.  Put into ... /recorder directory:

-        RPApplet4800.cab, RPApplet4800.jar – recording applet,

-        jaudio4800.tar – voice capture dll,

-        VPlayerSDK4800.cab, VPlayerSDK4800.jar – voice streaming applet,

 

2.3.   Put into ... /voicefiles directory:

-        retr.asp,

-        Retrieve.dll,

-        saver.dll.

 

2.4.rec_app.html – is example of using of the recording applet, play_app.html is example of using of the playback applet. Put the rec_app.html, play_app.html  into the directory where your *.html files are stored. Change in the rec_app.html, play_app.html examples the VIMAS Technologies web server URL  www.vimas.com to your URL. We recommend you to start with rec_app.html and play_app.html examples.

 

2.5.Register the Retrieve.dll and saver.dll as COM objects by using the regsvr32.exe program.

 

2.6.In the applet parameters:

  <PARAM NAME = "ServerScript"         VALUE = "http://www.vimas.com/cgi-bin/retrive.pl"> change to

     VALUE= "http://www.vimas.com/voicefiles/retr.asp"> .

 

2.7.In the applet parameter

      a) <PARAM NAME = "TimeLimit"                 VALUE = "20">

the maximal recording time (in sec.) is determined. Value range is 1....3599 sec.

In the demo version the  20 sec. limitation is used independently from TimeLimit value .          

         b) In the    <PARAM NAME = "BgColor"                            VALUE = "000000">  

set the background color of web page.

 

 

You can customize the JavaScript code correspondingly to your scenario.

 

Troubleshooting

 

1.          Recording applet does not work properly.

        1.1.  I can not record the voice message

        1.2.  I can not upload the voice file to server.

2.          Playback applet does not work.

     

 

 

 

I can not record the voice message

 

-        you use rec_app.html example. You see the buttons on the page, push on the “Record” button but recording applet does not record the sound. Alert window is appears with “Error. Object does not support this property or method” message is appeared.

Reasons:

a)                    probably, recording applet did not download from server to client machine. For successful downloading the  RPApplet.cab and RPApplet.jar must be on the server in the same directory with web page which calls the applet ( rec_app.html).  The RPApplet.cab and RPApplet.jar can be placed also in the other directory, but in the APPLET CODE must be indicated the full path to RPApplet.cab and RPApplet.jar:  CODEBASE=http://www.yourURL.com/recorder/   

We recommend you create the directories as in the documentation is recommended. After applet will work properly, you can re-create directories as you want, correspondingly to your web application.

b)                   please, check if the jaudio4800.tar installed on your computer. It should be installed automatically when you use the applet first time. On the server the jaudio4800.tar must be in the same directory with RPApplet.cab and RPApplet.jar.  Probably, you was wrong and jaudio4800.tar in the other directory. 

c)     If voice recording still does not work, please, copy the Java console content and send to support: info@vimas.com  .You can find the Java console in the Internet Explorer browser in the View menu in the bottom. If you do not see the Java console there, please, go to Tools->Internet option ->Advanced and choose in the Microsoft VM section the “Java console enabled”. In the Netscape 7 browser the Java console in the Tools->Web Development.

 

 

I can not upload the voice file to server.

 

-   you recorded the voice message and  can  playback it from your local computer successfully. You entered the name of file and push the “Send” button, in the status line you see “Uploading voice message...”, but after uploading the alert window appear with  Your message could not be uploaded” message.

 Reasons:  something wrong on the server side .

a)     check the /recorder and /voicefiles directories. They must be in the root of server.

b)    If you use Unix based server, check the retrieve.pl file. It must be in the cgi-bin/  directory.  If retrieve.pl is there, pay your attention to the items 1.5  and 1.6

c)     If you use IIS, check the retr.asp, Retrieve.dll, saver.dll. They must be in the /voicefiles directory.  Retrieve.dll and saver.dll are COM object, so they must be registered on the server as COM objects.

d)    If you use IIS, check the set up privileges on  NTFS-partition of  your server. Be sure that all users have write access to the root of your c:\-drive.

 

 

Playback applet does not work

 

-        you push Play button, alert window with “Error. Object does not support this property or method” message is appeared.

  Reasons:

a)                    probably, playback applet did not download from server to client machine. For successful downloading the  Vplayer4800.cab and Vplayer4800.jar must be on the server in the same directory with web page which calls the applet ( play_app.html).  The Vplayer4800.cab and Vplayer4800.jar can be placed also in the other directory, but in the APPLET CODE must be indicated the full path to Vplayer4800.cab and Vplayer4800.jar:  CODEBASE=http://www.yourURL.com/recorder/   

 

-        you push the Play button, alert window with “Please check the voice file name” message is   appeared.

Reasons:

a)     probably, the “pathToFile” applet parameter is wrong. Please, check it. Full path to voice file must be indicated.

b)    Be sure that voice file in the directory which indicated in the “pathToFile” parameter is located.

 

 

 
 

Appendix A

 

We present here for better understanding how applet send voice file to server the fragment of Java source code which sends HTTP request (POST) to CGI-program.

 

 

URL url = new URL(Messages.scriptURL);

URLConnection urlConn = url.openConnection();

urlConn.setDoInput( true );

urlConn.setDoOutput( true );

urlConn.setUseCaches( false );

urlConn.setRequestProperty("Content-Type", "application/octet-stream");

OutputStream os = urlConn.getOutputStream();

os.write((HTTP_HEADER + contentLength + "\r\n" + "\r\n").getBytes());

os.write(HTTP_RequestUpload.getBytes());

os.write(VoiceBuf, 0, countBytesOfVoiceData);

os.flush();

os.close();

where -

    HTTP_HEADER = "POST" + "/cgi-bin/retrive.pl" + "HTTP/1.0" + "\r\n" + "Content-type: " + "application/octet-stream" + "\r\n" +                                 "Content-length: ";

  HTTP_RequestUpload = "ACTION" + "\r\n" + "CREATE" + "\r\n" + voiceFileOnServer + "\r\n";

 contentLengthHTTP_RequestUpload.getBytes().length + countBytesOfVoiceData;

 VoiceBuf - array voice data (size=countBytesOfVoiceData);

CGI-program return “ACCEPTED” if upload is successful and “IOException” – if error is occurred.

 

 

For support: info@vimas.com