voxforge.org
VoxForge Dev

Changeset 2366

Show
Ignore:
Timestamp:
12/02/07 22:50:16 (10 months ago)
Author:
kmaclean
Message:

SpeechSubmission applet and server code snapshot

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/CapturePlayback.java

    r2365 r2366  
    486486        microphoneChooser.addActionListener(new ActionListener(){ 
    487487                 public void actionPerformed(ActionEvent e){ 
    488                      microphone = (String)dialectChooser.getSelectedItem(); 
     488                     microphone = (String)microphoneChooser.getSelectedItem(); 
    489489                 } 
    490490                 }); 
     
    12351235                   //      \w   A word character: [a-zA-Z_0-9] 
    12361236                   //      \W   A non-word character: [^\w] 
    1237                            userName = (usernameTextField.getText().replaceAll("\\W","")); 
     1237// !!!!!! removed to debug php uploader                     
     1238//                         userName = (usernameTextField.getText().replaceAll("\\W","")); 
     1239// !!!!!!                   
    12381240                   if (userName.length() == 0 ) { 
    12391241                       userName = "anonymous"; 
     
    17881790                                out_readme.write("Gender: " + gender + System.getProperty("line.separator") ); 
    17891791                                out_readme.write("Age Range: " + ageRange + System.getProperty("line.separator"));  
     1792                                out_readme.write("Language: " + language + System.getProperty("line.separator"));        
    17901793                                out_readme.write("Pronunciation dialect: " + dialect + System.getProperty("line.separator"));    
    17911794                                out_readme.write(System.getProperty("line.separator")); 
  • Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/LabelLocalizer.java

    r2364 r2366  
    99     
    1010    private String pleaseSelect; 
     11    private String other; 
    1112    private String notApplicable; 
    1213     
     
    132133             
    133134             pleaseSelect = "Maak een keuze"; 
     135             other = "anders"; 
    134136             notApplicable = "unknown"; 
    135137             
     
    148150              
    149151             dialectPanelLabel = "dialect:";  
    150              dialectSelection = new String [3]; 
     152             dialectSelection = new String [10]; 
    151153             dialectSelection[0] = pleaseSelect;     
    152              dialectSelection[1] = "standaard Nederlands";     
    153              dialectSelection[2] = "anders";    // other 
     154             dialectSelection[1] = "algemeen Nederlands";     
     155             dialectSelection[2] = "Zuidwestelijk";    
     156             dialectSelection[3] = "Noordwestelijk";     
     157             dialectSelection[4] = "Noordoostelijk";       
     158             dialectSelection[5] = "Noordelijk-centraal";     
     159             dialectSelection[6] = "Zuidoostelijk";    
     160             dialectSelection[7] = "Surinaams-Nederlands";     
     161             dialectSelection[8] = "Antiliaans-Nederlands";    
     162             dialectSelection[9] = other;             
    154163 
    155164             microphonePanelLabel = "type microfoon:"; 
     
    163172             microphoneSelection[6] = "webcam microfoon";       
    164173             microphoneSelection[7] = "studiomicrofoon";  
    165              microphoneSelection[8] = "anders";  // other 
     174             microphoneSelection[8] = other;   
    166175             
    167176             uploadText = "<html>druk op de knop \"doneren\" om het auteursrecht in de opgenomen  <br>" + 
  • Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/License.java

    r2364 r2366  
    4848                 
    4949                VFlicenseNotice =   
    50                   "VoxForge Speech Submission Application v0.1.1 - allows a user to record their speech and  " + System.getProperty("line.separator") 
    51                 + " upload the recorded audio to the VoxForge server, so that it can be" + System.getProperty("line.separator")  
    52                 + "incorporated into the VoxForge Speech Corpus and used in the creation of " + System.getProperty("line.separator")  
    53                 + "GPL acoustic models." + System.getProperty("line.separator") + System.getProperty("line.separator") 
    54  
    55                 + "Copyright (C) 2007  VoxForge" + System.getProperty("line.separator") + System.getProperty("line.separator") 
    56                  
     50                  "VoxForge Speech Submission Application v0.1.1" + System.getProperty("line.separator") 
     51                + "============================" + System.getProperty("line.separator") 
     52                + "Allows a user to record their speech and upload it to the VoxForge server" + System.getProperty("line.separator")  
     53            + "so that it can be incorporated into the VoxForge speech corpus and used" + System.getProperty("line.separator")  
     54                + "in the creation of GPL acoustic models." + System.getProperty("line.separator")  
     55                + System.getProperty("line.separator") 
     56                + "Notice:" + System.getProperty("line.separator")  
     57                + "====" + System.getProperty("line.separator")  
     58                + "Copyright (C) 2007  VoxForge" + System.getProperty("line.separator")  
     59                + System.getProperty("line.separator") 
    5760            + "This program is free software: you can redistribute it and/or modify" + System.getProperty("line.separator") 
    5861                + "them under the terms of the GNU General Public License as published by" + System.getProperty("line.separator") 
     
    6871                + "along with these files.  If not, see <http://www.gnu.org/licenses/>." + System.getProperty("line.separator") 
    6972                + System.getProperty("line.separator") 
    70                 + "This Java Applet incorporates open-source "+ System.getProperty("line.separator") 
    71                 + "Java code from other projects:"+ System.getProperty("line.separator") 
     73                + "Acknowledgments:" + System.getProperty("line.separator")  
     74                + "===========" + System.getProperty("line.separator")  
     75                + "This Java Applet incorporates open-source Java code"+ System.getProperty("line.separator") 
     76                + "from other projects:"+ System.getProperty("line.separator") 
    7277                + "   - MoodleSpeex, (c) Dan Stowell 2006."+ System.getProperty("line.separator") 
    7378                + "   - JSpeex player/recorder, (c) Wimba S.A."+ System.getProperty("line.separator") 
     
    7580                + "   - JavaSoundDemo,          (c) Sun Microsystems"+ System.getProperty("line.separator") 
    7681                + "Please see the licences stored in the \"copyrights\" folder in the " + System.getProperty("line.separator") 
    77                 + "speechsubmission jar file for more details."; 
     82                + "speechsubmission jar file for more details."+ System.getProperty("line.separator") 
     83                + System.getProperty("line.separator") 
     84                + "The English prompts are from the FestVox CMU_ARCTIC speech synthesis database."+ System.getProperty("line.separator") 
     85                + "(the utterances were selected from out-of-copyright texts from Project Gutenberg)"+ System.getProperty("line.separator") 
     86                + System.getProperty("line.separator") 
     87                + "Full GPL License:" + System.getProperty("line.separator") 
     88                + "=========" ; 
    7889                 
    7990                gplLicense = "                   GNU GENERAL PUBLIC LICENSE" + System.getProperty("line.separator") 
  • Trunk/SpeechSubmission/VFSpeechSubmission/server/WebGUI/SpeechSubmission.pm

    r2290 r2366  
    1212 
    1313use strict; 
    14  
     14use WebGUI::Session::Http; 
    1515#------------------------------------------------------------------- 
    1616sub process { 
    1717        my $session = shift; 
    18                 my $userID =$session->var->get("userId") || "test";  
    19 my $output = '<applet name="Speexuploader" width ="800" height ="800" mayscript="mayscript" 
    20       code="moodlespeex/MoodleSpeexRecorderApplet.class"  
    21       codebase="http://www.repository.voxforge1.org/SubmitSpeech" style="border: 1px solid rgb(153,153,153);">'; 
    22 $output .= '<param name="archive"  value="moodlespeex.jar"/>'; 
    23 $output .= '<param name="type"  value="application/x-java-applet;version=1.4"/>'; 
    24 $output .= '<param name="scriptable"  value="true"/>'; 
    25 $output .= '<param name="destination" value="http://www.repository.voxforge1.org/SubmitSpeech/javaUploadServer.php"/>'; 
    26 $output .= '<param name="endpage"  value="http://www.repository.voxforge1.org/SubmitSpeech/endpage.html"/>'; 
    27 $output .= "<param name=\"cookie\"  value=\"" . $$userID . "\"/>"; 
    28 $output .= '</applet>'; 
     18 
     19        my $username =$session->user->username || "test";  
     20        my $http = WebGUI::Session::Http->new($session); 
     21        $http->setCookie("user","WebGUICookie",3600);    
     22my $output = ' 
     23<applet name="VoxForge.org Speech Submission Application" width ="825" height ="875" mayscript="mayscript" 
     24      code="speechrecorder/RecorderApplet.class" style="border: 1px solid rgb(153,153,153);"> 
     25<param name="codebase"  value="http://localhost:90/httpd/"/> 
     26<param name="archive"  value="speechrecorder.jar"/> 
     27<param name="type"  value="application/x-java-applet;version=1.4"/> 
     28<param name="scriptable"  value="true"/> 
     29<param name="destination" value="http://localhost:90/httpd/javaUploadServer.php"/> 
     30<param name="endpage"  value="http://localhost:90/httpd/endpage.html"/> 
     31<param name="cookie"  value="$username"/> 
     32</applet>'; 
    2933 
    3034        return $output; 
  • Trunk/SpeechSubmission/VFSpeechSubmission/server/javaUploadServer.php

    r2330 r2366  
    2525// Note, this MUST have the trailing slash. 
    2626//$uploaddir = 'public/'; 
    27 $uploaddir = '../public/speechsubmissions/'; 
     27$uploaddir = 'audiosubmissions/'; 
    2828// Whether or not to allow the upload of specific files 
    2929$allow_or_deny = true; 
     
    3333$file_extension_list = array("zip"); 
    3434// ----------------------------------------------------------------------------- 
     35 
     36var_dump($_FILES);  
     37 
    3538if ($allow_or_deny){ 
    3639        if (($allow_or_deny_method == "allow" && !in_array(strtolower(array_pop(explode('.', $_FILES['userfile']['name']))), $file_extension_list)) 
     
    4750        } 
    4851} 
    49 if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir .$_FILES['userfile']['name'])) 
     52// !!!!!! 
     53// limits the length of the filename to 25 char 
     54// removes non-alphanumeric characters from file name 
     55// listfiles needs to remove random number 
     56 
     57$newname = $_FILES['userfile']['name']; 
     58$newname =  ereg_replace  (  "\.zip"  , ""  , $newname  ); 
     59$newname = substr($newname , 0, 25); 
     60$newname =  ereg_replace  (  "[^a-zA-Z0-9_-]"  , ""  , $newname  ); 
     61 
     62$ran = rand () ; 
     63$newname = $newname . "[" . $ran . "]" . ".zip"; 
     64//$newname = $newname . " .zip"; 
     65// !!!!!! 
     66if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir .$newname)) 
    5067{ 
    5168        // All replies MUST start with "POSTLET REPLY", if they don't, then Postlet will 
  • Trunk/SpeechSubmission/VFSpeechSubmission/server/localSubmitSpeechServer.php

    r2365 r2366  
    1111 
    1212 
    13 function speex_postlet_applet($destination, $endpage,  $codebase, 
    14                 $subject='', $filefieldname='userfile', $compressionmode=1, $compressionmodes='1,2,3'){ 
     13function speex_postlet_applet($destination, $endpage,  $codebase,  $filefieldname='userfile'){ 
    1514  global $CFG; 
    1615  $cookie = htmlspecialchars($_SERVER['HTTP_COOKIE']); 
    1716  $code =  <<<ENDHTMLFRAGMENT 
    18 <applet name="VoxForge.org Speech Submission Application" width ="825" height ="875" mayscript="mayscript" 
     17<applet name="VoxForge.org Speech Submission Application" width ="825" height ="950" mayscript="mayscript" 
    1918      code="speechrecorder/RecorderApplet.class" style="border: 1px solid rgb(153,153,153);"> 
    2019 <param name="codebase"  value="$codebase"/> 
     
    2524 <param name="endpage"  value="$endpage"/> 
    2625 <param name="cookie"  value="$cookie"/> 
     26 <param name="language"  value="NL"/> 
    2727<table style="background-color: rgb(255, 195, 1);" border="1" height="24" width="550"><tbody><tr><td> The VoxForge Speech Submission Applet should appear here. Please see the VoxForge <a href="http://www.voxforge.org/home/read2/java" color="ffffff">Java Troubleshooting Guide</a> to determine if you have Java installed on your PC - this is required in order to use the audio recorder.<br></td></tr></tbody></table> 
    2828 
     
    3232} 
    3333 
     34 
     35 
     36 
    3437?>