Changeset 2326
- Timestamp:
- 10/08/07 22:00:57 (11 months ago)
- Files:
-
- Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/CapturePlayback.java (modified) (21 diffs)
- Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/License.java (modified) (1 diff)
- Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/RecorderApplet.java (modified) (1 diff)
- Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/copyrights (modified) (1 prop)
- Trunk/SpeechSubmission/VFSpeechSubmission/server/SubmitSpeechServer.php (modified) (1 diff)
- Trunk/SpeechSubmission/VFSpeechSubmission/server/archive/NewSubmitSpeechServer.php (moved) (moved from Trunk/SpeechSubmission/VFSpeechSubmission/server/NewSubmitSpeechServer.php)
- Trunk/SpeechSubmission/VFSpeechSubmission/server/index.php (moved) (moved from Trunk/SpeechSubmission/VFSpeechSubmission/server/Start.php) (3 diffs)
- Trunk/SpeechSubmission/VFSpeechSubmission/server/javaUpload.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/CapturePlayback.java
r2319 r2326 317 317 318 318 int compressionMode = 2; // Simple compression 1 (loqual) 2 (med) 3 (hiqual) 319 320 String tempdir = getTempDir(); 319 321 // !!!!!! 320 322 // public CapturePlayback(String subject, String fileFieldName, … … 390 392 wavFile.deleteOnExit(); 391 393 // !!!!!! 392 393 File dir=File.createTempFile("VF-dir",null);394 dir.delete();395 dir.mkdir();396 String tempdir = dir.toString();397 if ( !(tempdir.endsWith("/") || tempdir.endsWith("\\")) )398 tempdir = tempdir + System.getProperty("file.separator");399 400 394 wavFile1 = new File(tempdir + "wavFile1.wav"); 401 395 wavFile1.deleteOnExit(); … … 757 751 JPanel DisclaimerInnerPanel = new JPanel(); 758 752 String DisclaimerText = 759 "<html> <br>VoxForge SpeechSubmission Applet - Copyright (C) 2007VoxForge<br>"753 "<html>VoxForge SpeechSubmission Applet - Copyright (C) 2007 VoxForge<br>" 760 754 +"This program comes with ABSOLUTELY NO WARRANTY; without even the implied<br> " 761 755 +"warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For<br>" 762 756 +"details click the \"About\" button:"; 763 Disclaimer Panel.add(new JLabel(DisclaimerText));757 DisclaimerInnerPanel.add(new JLabel(DisclaimerText)); 764 758 aboutB = addButton("About", DisclaimerInnerPanel, true); 765 766 767 // DisclaimerInnerPanel.setBorder(BorderFactory.createLineBorder (voxforgeColour, 3)); 768 // DisclaimerInnerPanel.add(new JLabel(DisclaimerText)); 759 DisclaimerInnerPanel.setBorder(BorderFactory.createLineBorder (voxforgeColour, 3)); 760 769 761 DisclaimerPanel.add(DisclaimerInnerPanel); 770 762 p2.add(DisclaimerPanel); … … 775 767 public void open() { } 776 768 769 private String getTempDir() { 770 String tempdir=null; 771 try { 772 File dir=File.createTempFile("VF-dir",null); 773 dir.delete(); 774 dir.mkdir(); 775 tempdir = dir.toString(); 776 if ( !(tempdir.endsWith("/") || tempdir.endsWith("\\")) ) 777 tempdir = tempdir + System.getProperty("file.separator"); 778 779 } catch (Exception e) { 780 System.err.println("Unable to create temp directory\n" + e); 781 } 782 return tempdir; 783 } 777 784 778 785 public void close() { … … 815 822 816 823 private void setButtonsOff() { 817 System.err.println("setButtonsOff" );824 // debug System.err.println("setButtonsOff" ); 818 825 play1.setEnabled(false); 819 826 capt1.setEnabled(false); … … 839 846 840 847 private void saveButtonState() { 841 System.err.println("saveButtonState" );848 // debug System.err.println("saveButtonState" ); 842 849 if (play1.isEnabled()) {play1_state = true;} else {play1_state = false;} 843 850 if (play2.isEnabled()) {play2_state = true;} else {play2_state = false;} … … 863 870 864 871 private void restoreButtonState() { 865 System.err.println("restoreButtonState" );872 // debug System.err.println("restoreButtonState" ); 866 873 if (play1_state) {play1.setEnabled(true);} else {play1.setEnabled(false);} 867 874 if (play2_state) {play2.setEnabled(true);} else {play2.setEnabled(false);} … … 1532 1539 1533 1540 JOptionPane.showMessageDialog(this, areaScrollPane, 1534 " More info on Copyright and GPL license", JOptionPane.PLAIN_MESSAGE);1541 "About VoxForge Speech Submission Application", JOptionPane.PLAIN_MESSAGE); 1535 1542 } 1536 1543 } … … 1925 1932 } 1926 1933 1927 System.err.println("thread==null, recording thread about to tidy up");1934 // debug System.err.println("thread==null, recording thread about to tidy up"); 1928 1935 1929 1936 // we reached the end of the stream. stop and close the line. … … 1952 1959 } catch (Exception ex) { reportStatus(ex.toString()); } 1953 1960 // !!!!!! 1954 System.err.println("About to load bytes to byte array");1961 // debug System.err.println("About to load bytes to byte array"); 1955 1962 byte audioBytes[] = outbaos.toByteArray(); 1956 1963 // System.err.println("Loaded bytes to byte array"); … … 1963 1970 duration = totalBytesWritten / (double) (format.getSampleRate() * format.getSampleSizeInBits()/ 8); 1964 1971 // !!!!!! 1965 System.err.println("Calculated duration");1972 // debug System.err.println("Calculated duration"); 1966 1973 // !!!!!! 1967 1974 // samplingGraph.createWaveForm(audioInputStream); 1968 1975 samplingGraph.createWaveForm(audioBytes); 1969 1976 // !!!!!! 1970 System.err.println("Created samplingGraph");1977 // debug System.err.println("Created samplingGraph"); 1971 1978 1972 1979 // This is the only way to "reset" long streams - re-grab … … 1992 1999 } 1993 2000 1994 System.err.println("About to grab audio input stream from cache file");2001 // debug System.err.println("About to grab audio input stream from cache file"); 1995 2002 try { 1996 2003 // audioInputStream = AudioSystem.getAudioInputStream(wavFile); … … 2004 2011 System.err.println("Exception while reading cache file: " + err); 2005 2012 } 2006 System.err.println("Grabbed audio input stream from cache file");2013 // debug System.err.println("Grabbed audio input stream from cache file"); 2007 2014 } 2008 2015 … … 2124 2131 // totalBytes = ((int)spxFile.length()); 2125 2132 progBar.setMaximum((int)wavFile.length()); 2126 totalBytes = ((int)wavFile.length());2133 // totalBytes = ((int)wavFile.length()); 2127 2134 // !!!!!! 2128 2135 progBar.setMinimum(0); … … 2167 2174 files[9] = uploadWavFile9; 2168 2175 files[10] = uploadWavFile10; 2176 2169 2177 //############ prompt files #################################### 2170 2178 try { … … 2276 2284 } 2277 2285 2278 2279 2286 if (userName != null){ 2280 archiveFile = new File( userName + "-" + date + "-" + randomID + ".zip");2287 archiveFile = new File(tempdir + userName + "-" + date + "-" + randomID + ".zip"); 2281 2288 } else { 2282 archiveFile = new File( "Anonymous-" + date + "-" + randomID + ".zip");2289 archiveFile = new File(tempdir +"Anonymous-" + date + "-" + randomID + ".zip"); 2283 2290 } 2284 2291 2285 2292 createZipArchive(archiveFile, files); 2286 2293 System.err.println("Archive file location:" + archiveFile); 2287 System.err.println("username:" + userName + ":"); 2294 // debug System.err.println("username:" + userName + ":"); 2295 //!!!!!! 2296 totalBytes = ((int)archiveFile.length()) ; 2297 // !!!!!! 2288 2298 //############ Upload #################################### 2289 2299 … … 2560 2570 2561 2571 // .. draw current position .. 2562 System.err.println("seconds "+seconds+";duration:"+duration+":");2572 // debug System.err.println("seconds "+seconds+";duration:"+duration+":"); 2563 2573 if (seconds != 0) { 2564 2574 double loc = seconds/duration*w; … … 2593 2603 2594 2604 seconds = milliseconds / 1000.0; 2595 System.err.println("playback.line:seconds "+seconds+";milliseconds:"+milliseconds+":");2605 // debug System.err.println("playback.line:seconds "+seconds+";milliseconds:"+milliseconds+":"); 2596 2606 } else if ( (capture.line != null) && (capture.line.isActive()) ) { 2597 2607 2598 2608 long milliseconds = (long)(capture.line.getMicrosecondPosition() / 1000); 2599 2609 seconds = milliseconds / 1000.0; 2600 System.err.println("capture.line:seconds "+seconds+";milliseconds:"+milliseconds+":");2610 // debug System.err.println("capture.line:seconds "+seconds+";milliseconds:"+milliseconds+":"); 2601 2611 2602 2612 } … … 2626 2636 //DEL progCompletion.setText(pLabels.getLabel(2)); 2627 2637 if (endPageURL != null){ 2638 progBar.setString("Upload completed... Thank you for your submission!"); 2639 progBar.setIndeterminate(false); 2628 2640 System.err.println("Finished! Sending you on to "+endPageURL); 2629 2641 ((JApplet)(getParent().getParent().getParent().getParent())).getAppletContext().showDocument(endPageURL); … … 2633 2645 // Attempt at calling Javascript after upload is complete. 2634 2646 //FORDEBUG 2635 System.err.println("setProgress(): endPageURL is null, so trying to use the javascript hook to end.");2647 System.err.println("setProgress(): endPageURL is null, so trying to use the javascript hook to end."); 2636 2648 JSObject win = (JSObject) JSObject.getWindow((JApplet)getParent()); 2637 2649 win.eval("postletFinished();"); … … 2644 2656 } else { 2645 2657 //FORDEBUG 2646 //System.err.println("setProgress(): Not reached end yet. sentBytes="+sentBytes+", totalBytes="+totalBytes);2658 System.err.println("setProgress(): Not reached end yet. sentBytes="+sentBytes+", totalBytes="+totalBytes); 2647 2659 } 2648 2660 } Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/License.java
r2322 r2326 48 48 49 49 VFlicenseNotice = 50 "VoxForge Speech Submission Application- allows a user to record their speech and " + System.getProperty("line.separator")50 "VoxForge Speech Submission Application v0.1 - allows a user to record their speech and " + System.getProperty("line.separator") 51 51 + " upload the recorded audio to the VoxForge server, so that it can be" + System.getProperty("line.separator") 52 52 + "incorporated into the VoxForge Speech Corpus and used in the creation of " + System.getProperty("line.separator") Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/RecorderApplet.java
r2317 r2326 213 213 214 214 /* HELPPAGE */ 215 try {216 helpPageURL = new URL(getParameter("helppage"));217 } catch(java.net.MalformedURLException malurlex){218 errorMessage(System.out, "helppage is badly formed:###"+getParameter("helppage")+"###");219 } catch(java.lang.NullPointerException npe){220 errorMessage(System.out, "helppage is null");221 }215 // try { 216 // helpPageURL = new URL(getParameter("helppage")); 217 // } catch(java.net.MalformedURLException malurlex){ 218 // errorMessage(System.out, "helppage is badly formed:###"+getParameter("helppage")+"###"); 219 // } catch(java.lang.NullPointerException npe){ 220 // errorMessage(System.out, "helppage is null"); 221 // } 222 222 } 223 223 Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/copyrights
- Property svn:ignore set to
prompts.temp
- Property svn:ignore set to
Trunk/SpeechSubmission/VFSpeechSubmission/server/SubmitSpeechServer.php
r2325 r2326 16 16 $cookie = htmlspecialchars($_SERVER['HTTP_COOKIE']); 17 17 $code = <<<ENDHTMLFRAGMENT 18 <applet name="VoxForge.org Speech Submission Application" width ="8 00" height ="850" mayscript="mayscript"18 <applet name="VoxForge.org Speech Submission Application" width ="825" height ="875" mayscript="mayscript" 19 19 code="speechrecorder/RecorderApplet.class" style="border: 1px solid rgb(153,153,153);"> 20 20 <param name="codebase" value="$codebase"/> Trunk/SpeechSubmission/VFSpeechSubmission/server/index.php
r2325 r2326 8 8 } 9 9 .copyright { 10 te st-align: left;10 text-align: left; 11 11 color: #2E3436; 12 12 font-family: sans-serif; … … 155 155 <p>After each recording, the black box near the bottom of your screen will display the audio waveform corresponding to the currently active recording. Please avoid recording clipped speech (i.e. recording with the volume to high). The grey bar below the upload button will display a warning if your recording volume is too loud.</p> 156 156 <p>Once you have completed recording all ten prompts the <b>Upload</b> button will activate. Click the <b>Upload</b> button to upload your entire submission to the VoxForge repository as a single zip file.</p> 157 <p>Thank you for helping Free and Open Source Speech Recogn tion!</p>157 <p>Thank you for helping Free and Open Source Speech Recognition!</p> 158 158 </br> 159 159 <?php … … 161 161 162 162 echo speex_postlet_applet( 163 'http:// www.repository.voxforge1.org/SubmitSpeech/javaUploadServer.php',164 'http:// www.repository.voxforge1.org/SubmitSpeech/endpage.php',165 'http:// www.repository.voxforge1.org/SubmitSpeech'163 'http://read.voxforge1.org/javaUploadServer.php', 164 'http://read.voxforge1.org/endpage.php', 165 'http://read.voxforge1.org' 166 166 ); 167 167 Trunk/SpeechSubmission/VFSpeechSubmission/server/javaUpload.php
r2290 r2326 24 24 // or "c:\php\uploads\" 25 25 // Note, this MUST have the trailing slash. 26 $uploaddir = '/home/kmaclean/httpd/audiosubmissions/'; 26 //$uploaddir = 'public/'; 27 $uploaddir = '../public/speechsubmissions/'; 27 28 // Whether or not to allow the upload of specific files 28 $allow_or_deny = false;29 $allow_or_deny = true; 29 30 // If the above is true, then this states whether the array of files is a list of 30 31 // extensions to ALLOW, or DENY