Changeset 2290
- Timestamp:
- 09/09/07 22:04:40 (1 year ago)
- Files:
-
- Trunk/SpeechSubmission/VFSpeechSubmission/java/src/moodlespeex (modified) (1 prop)
- Trunk/SpeechSubmission/VFSpeechSubmission/java/src/moodlespeex/CapturePlayback.java (modified) (12 diffs)
- Trunk/SpeechSubmission/VFSpeechSubmission/java/src/moodlespeex/License.java (modified) (1 diff)
- Trunk/SpeechSubmission/VFSpeechSubmission/java/src/moodlespeex/MoodleSpeexRecorderApplet.java (modified) (3 diffs)
- Trunk/SpeechSubmission/VFSpeechSubmission/java/src/net/sf/postlet/UploadManager.java (modified) (1 diff)
- Trunk/SpeechSubmission/VFSpeechSubmission/java/src/org/voxforge/JavaVersionDisplayApplet.java (modified) (1 diff)
- Trunk/SpeechSubmission/VFSpeechSubmission/server/WebGUI (added)
- Trunk/SpeechSubmission/VFSpeechSubmission/server/WebGUI/SpeechSubmission.pm (added)
- Trunk/SpeechSubmission/VFSpeechSubmission/server/WebGUI/WebGUI-SpeechSubmissionArticle (moved) (moved from Trunk/SpeechSubmission/VFSpeechSubmission/server/WebGUI-SpeechSubmissionArticle) (1 diff)
- Trunk/SpeechSubmission/VFSpeechSubmission/server/javaUpload.php (modified) (previous)
- Trunk/SpeechSubmission/VFSpeechSubmission/server/submitSpeechServerTest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Trunk/SpeechSubmission/VFSpeechSubmission/java/src/moodlespeex
- Property svn:ignore set to
SamplingGraph-Moodlespeex.java
SamplingGraph-Sun.java
- Property svn:ignore set to
Trunk/SpeechSubmission/VFSpeechSubmission/java/src/moodlespeex/CapturePlayback.java
r2278 r2290 78 78 public static int BUFFER_SIZE = 10240; 79 79 public static final String fileType = "wav"; 80 public static final int samplingRate = 48000; 80 public static final int samplingRate = 48000; 81 // public static final int samplingRate = 44100; // jre 1.4.2 only supports max of 44100 81 82 public static final int samplingRateFormat = 16; 82 83 public static final int numberChannels = 1; 84 /*this code snippet might work to query audio card for sampling rate ... 85 * DataLine.Info info = new DataLine.Info(TargetDataLine.class, 86 samplingRateFormat); // format is an AudioFormat object 87 if (!AudioSystem.isLineSupported(info)) { 88 // Handle the error. 89 } 90 // Obtain and open the line. 91 try { 92 line = (TargetDataLine) AudioSystem.getLine(info); 93 line.open(format); 94 } catch (LineUnavailableException ex) { 95 // Handle the error. 96 //... 97 } 98 99 */ 100 83 101 AudioFormat format = new AudioFormat(samplingRate, samplingRateFormat, numberChannels, true, false); 102 84 103 // !!!!!! 85 104 Capture capture = new Capture(); … … 440 459 System.err.println("CapturePlayback's WAV file for recording wavFile4 is:" + wavFile4); 441 460 System.err.println("CapturePlayback's WAV file for recording wavFile5 is:" + wavFile5); 461 System.err.println("CapturePlayback's WAV file for recording wavFile1 is:" + wavFile6); 462 System.err.println("CapturePlayback's WAV file for recording wavFile2 is:" + wavFile7); 463 System.err.println("CapturePlayback's WAV file for recording wavFile3 is:" + wavFile8); 464 System.err.println("CapturePlayback's WAV file for recording wavFile4 is:" + wavFile9); 465 System.err.println("CapturePlayback's WAV file for recording wavFile5 is:" + wavFile10); 442 466 System.err.println("CapturePlayback's WAV file for recording uploadWavFile1 is:" + uploadWavFile1); 443 467 System.err.println("CapturePlayback's WAV file for recording uploadWavFile2 is:" + uploadWavFile2); … … 445 469 System.err.println("CapturePlayback's WAV file for recording uploadWavFile4 is:" + uploadWavFile4); 446 470 System.err.println("CapturePlayback's WAV file for recording uploadWavFile5 is:" + uploadWavFile5); 471 System.err.println("CapturePlayback's WAV file for recording uploadWavFile1 is:" + uploadWavFile6); 472 System.err.println("CapturePlayback's WAV file for recording uploadWavFile2 is:" + uploadWavFile7); 473 System.err.println("CapturePlayback's WAV file for recording uploadWavFile3 is:" + uploadWavFile8); 474 System.err.println("CapturePlayback's WAV file for recording uploadWavFile4 is:" + uploadWavFile9); 475 System.err.println("CapturePlayback's WAV file for recording uploadWavFile5 is:" + uploadWavFile10); 447 476 setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); 448 477 //setLayout(new GridBagLayout()); … … 1805 1834 return; 1806 1835 } 1807 // reset to the beginn ning of the stream1836 // reset to the beginning of the stream 1808 1837 try { 1809 1838 audioInputStream.reset(); … … 1858 1887 sentBytes = 0; 1859 1888 1860 System.err.println("Destination URL is " + destinationURL); 1861 if(subject != null) {1862 System.err.println("Adding subject to URL");1889 1890 //if(subject != null) { 1891 // System.err.println("Adding subject to URL"); 1863 1892 try { 1864 1893 // !!!!!! … … 1871 1900 } 1872 1901 System.err.println("Destination URL is " + destinationURL); 1873 }1902 //} 1874 1903 1875 1904 File[] files = new File[15]; … … 1899 1928 try { 1900 1929 BufferedWriter out_prompts = new BufferedWriter(new FileWriter(promptsFile)); 1901 out_prompts.write(promptID1 + " " + prompt1); 1902 out_prompts.append(System.getProperty("line.separator")); 1903 out_prompts.write(promptID2 + " " +prompt2); 1904 out_prompts.append(System.getProperty("line.separator")); 1905 out_prompts.write(promptID3 + " " +prompt3); 1906 out_prompts.append(System.getProperty("line.separator")); 1907 out_prompts.write(promptID4 + " " +prompt4); 1908 out_prompts.append(System.getProperty("line.separator")); 1909 out_prompts.write(promptID5 + " " +prompt5); 1910 out_prompts.append(System.getProperty("line.separator")); 1911 out_prompts.write(promptID6 + " " + prompt6); 1912 out_prompts.append(System.getProperty("line.separator")); 1913 out_prompts.write(promptID7 + " " +prompt7); 1914 out_prompts.append(System.getProperty("line.separator")); 1915 out_prompts.write(promptID8 + " " +prompt8); 1916 out_prompts.append(System.getProperty("line.separator")); 1917 out_prompts.write(promptID9 + " " +prompt9); 1918 out_prompts.append(System.getProperty("line.separator")); 1919 out_prompts.write(promptID10 + " " +prompt10); 1920 out_prompts.append(System.getProperty("line.separator")); 1930 out_prompts.write(promptID1 + " " + prompt1 + System.getProperty("line.separator")); 1931 out_prompts.write(promptID2 + " " + prompt2 + System.getProperty("line.separator")); 1932 out_prompts.write(promptID3 + " " + prompt3 + System.getProperty("line.separator")); 1933 out_prompts.write(promptID4 + " " + prompt4 + System.getProperty("line.separator")); 1934 out_prompts.write(promptID5 + " " + prompt5 + System.getProperty("line.separator")); 1935 out_prompts.write(promptID6 + " " + prompt6 + System.getProperty("line.separator")); 1936 out_prompts.write(promptID7 + " " + prompt7 + System.getProperty("line.separator")); 1937 out_prompts.write(promptID8 + " " + prompt8 + System.getProperty("line.separator")); 1938 out_prompts.write(promptID9 + " " + prompt9 + System.getProperty("line.separator")); 1939 out_prompts.write(promptID10 + " " + prompt10 + System.getProperty("line.separator")); 1921 1940 out_prompts.close(); 1922 1941 } catch (IOException e) { … … 1927 1946 try { 1928 1947 BufferedWriter out_readme = new BufferedWriter(new FileWriter(readmeFile)); 1929 out_readme.write("User Name:" + userName);out_readme.append(System.getProperty("line.separator")); 1930 out_readme.append(System.getProperty("line.separator")); 1931 1932 out_readme.write("Speaker Characteristics:");out_readme.append(System.getProperty("line.separator")); 1933 out_readme.append(System.getProperty("line.separator")); 1934 out_readme.write("Gender: " + gender);out_readme.append(System.getProperty("line.separator")); 1935 out_readme.write("Age Range: " + ageRange); out_readme.append(System.getProperty("line.separator")); 1936 out_readme.write("Pronunciation dialect: " + dialect); out_readme.append(System.getProperty("line.separator")); 1937 out_readme.append(System.getProperty("line.separator")); 1938 1939 out_readme.write("Recording Information:"); out_readme.append(System.getProperty("line.separator")); 1940 out_readme.append(System.getProperty("line.separator")); 1941 out_readme.write("Microphone make: n/a" );out_readme.append(System.getProperty("line.separator")); 1942 out_readme.write("Microphone type:" + microphone);out_readme.append(System.getProperty("line.separator")); 1943 out_readme.write("Audio card make:");out_readme.append(System.getProperty("line.separator")); 1944 out_readme.write("Audio card type:");out_readme.append(System.getProperty("line.separator")); 1945 out_readme.write("Audio Recording Software:");out_readme.append(System.getProperty("line.separator")); 1946 out_readme.write("O/S:");out_readme.append(System.getProperty("line.separator")); 1947 1948 out_readme.write("File Info:"); out_readme.append(System.getProperty("line.separator")); 1949 out_readme.append(System.getProperty("line.separator")); 1950 out_readme.write("File type: " + fileType);out_readme.append(System.getProperty("line.separator")); 1951 out_readme.write("Sampling Rate: " + samplingRate);out_readme.append(System.getProperty("line.separator")); 1952 out_readme.write("Sample rate format: " + samplingRateFormat);out_readme.append(System.getProperty("line.separator")); 1953 out_readme.write("Number of channels: " + numberChannels);out_readme.append(System.getProperty("line.separator")); 1948 out_readme.write("User Name:" + userName + System.getProperty("line.separator")); 1949 out_readme.write(System.getProperty("line.separator")); 1950 1951 out_readme.write("Speaker Characteristics:" + System.getProperty("line.separator") ); 1952 out_readme.write(System.getProperty("line.separator")); 1953 out_readme.write("Gender: " + gender + System.getProperty("line.separator") ); 1954 out_readme.write("Age Range: " + ageRange + System.getProperty("line.separator")); 1955 out_readme.write("Pronunciation dialect: " + dialect + System.getProperty("line.separator")); 1956 out_readme.write(System.getProperty("line.separator")); 1957 1958 out_readme.write("Recording Information:" + System.getProperty("line.separator")); 1959 out_readme.write(System.getProperty("line.separator")); 1960 out_readme.write("Microphone make: n/a" + System.getProperty("line.separator")); 1961 out_readme.write("Microphone type:" + microphone + System.getProperty("line.separator")); 1962 out_readme.write("Audio card make: unknown" + System.getProperty("line.separator")); 1963 out_readme.write("Audio card type: unknown" + System.getProperty("line.separator")); 1964 out_readme.write("Audio Recording Software: VoxForge Speech Submission Application" + System.getProperty("line.separator")); 1965 out_readme.write("O/S:" + System.getProperty("line.separator")); 1966 out_readme.write(System.getProperty("line.separator")); 1954 1967 1955 out_readme.write("License Info:"); out_readme.append(System.getProperty("line.separator")); 1956 out_readme.append(System.getProperty("line.separator")); 1957 out_readme.write("Copyright name: " + copyrightName);out_readme.append(System.getProperty("line.separator")); 1958 out_readme.write("Accepted that speech be covered by the GPL license: " + gplAccepted);out_readme.append(System.getProperty("line.separator")); 1968 out_readme.write("File Info:" + System.getProperty("line.separator")); 1969 out_readme.write(System.getProperty("line.separator")); 1970 out_readme.write("File type: " + fileType + System.getProperty("line.separator")); 1971 out_readme.write("Sampling Rate: " + samplingRate + System.getProperty("line.separator")); 1972 out_readme.write("Sample rate format: " + samplingRateFormat + System.getProperty("line.separator")); 1973 out_readme.write("Number of channels: " + numberChannels + System.getProperty("line.separator")); 1974 out_readme.write(System.getProperty("line.separator")); 1975 1976 out_readme.write("License Info:" + System.getProperty("line.separator")); 1977 out_readme.write(System.getProperty("line.separator")); 1978 out_readme.write("Copyright name: " + copyrightName + System.getProperty("line.separator")); 1979 out_readme.write("Accepted that speech be covered by the GPL license: " + gplAccepted + System.getProperty("line.separator")); 1959 1980 1960 1981 out_readme.close(); … … 1997 2018 int SMALL_LETTERS_BASE_VALUE = 97; 1998 2019 // int CAPITAL_LETTERS_BASE_VALUE = 65; 1999 StringBuilder randomID = new StringBuilder(""); 2020 StringBuffer randomID = new StringBuffer(""); // required for jvm 1.4.2 2021 //StringBuilder randomID = new StringBuilder(""); // will not work with JVM 1.4.2 2000 2022 for ( int i = 0; randomID.length() < 3; i++ ) 2001 2023 { … … 2030 2052 u = new UploadManager(archiveFiles, capturePlayback, destinationURL, fileFieldName); 2031 2053 } 2054 System.err.println("Uploading to " + destinationURL); 2032 2055 // !!!!!! 2033 2056 u.start(); … … 2431 2454 // Reset the applet 2432 2455 progBar.setValue(0); 2433 if(subject != null) { // Will be non-null if passed in as a param - even if blank2434 subjectBox.setEnabled(true);2435 }2456 // if(subject != null) { // Will be non-null if passed in as a param - even if blank 2457 // subjectBox.setEnabled(true); 2458 // } 2436 2459 } else { 2437 2460 //FORDEBUG … … 2443 2466 // If passed in as a param then we don't need to worry about trying to fetch it from the context 2444 2467 System.err.println("CapturePlayback Cookie: " + cookie +":\n"); 2445 System.err.println("CapturePlayback Cookie: " + this.cookie +":\n"); 2446 // if (cookie != null && !cookie.equals("")) 2447 // return cookie; 2448 cookie = "test"; 2468 System.err.println("CapturePlayback Cookie: " + this.cookie +":\n"); 2469 // !!!!!! 2470 if (cookie != null && !cookie.equals("")) 2471 return cookie; 2472 // cookie = "test"; 2473 // !!!!!!! 2449 2474 // Method reads the cookie in from the Browser using the LiveConnect object. 2450 2475 // May also add an option to set the cookie using an applet parameter FIXME! Trunk/SpeechSubmission/VFSpeechSubmission/java/src/moodlespeex/License.java
r2256 r2290 13 13 + System.getProperty("line.separator"); 14 14 15 licenseNotice = "These files are free software: you can redistribute them and/or modify" + System.getProperty("line.separator") 15 licenseNotice = "Copyright (C) <year> Free Software Foundation" + System.getProperty("line.separator") 16 + System.getProperty("line.separator") 17 + "These files are free software: you can redistribute them and/or modify" + System.getProperty("line.separator") 16 18 + "them under the terms of the GNU General Public License as published by" + System.getProperty("line.separator") 17 19 + "the Free Software Foundation, either version 3 of the License, or" + System.getProperty("line.separator") Trunk/SpeechSubmission/VFSpeechSubmission/java/src/moodlespeex/MoodleSpeexRecorderApplet.java
r2279 r2290 75 75 // !!!!!! 76 76 77 cookie = null;77 // cookie = null; 78 78 // getContentPane().add("Center", 79 79 // theRecorder = new CapturePlayback(subject, fileFieldName, … … 162 162 163 163 try { 164 // cookie = getParameter("cookie"); 165 cookie = "kenmacleantest"; 164 // !!!!!! 165 cookie = getParameter("cookie"); 166 // cookie = "kenmacleantest"; 167 // !!!!!! 166 168 System.err.println("MoodleSpeexRecorderApplet Cookie: " + cookie +":\n"); 167 169 } catch (NullPointerException nullLang){ … … 184 186 /* DESTINATION */ 185 187 try { 186 // destinationURL = new URL(getParameter("destination")); 188 // !!!!!! 189 destinationURL = new URL(getParameter("destination")); 187 190 // Following line is for testing, and to hard code the applet to postlet.com 188 // !!!!!! 189 destinationURL = new URL("http://localhost:90/httpd/postlet/javaUpload.php");191 192 // destinationURL = new URL("http://localhost:90/httpd/postlet/javaUpload.php"); 190 193 // !!!!!! 191 194 } catch(java.net.MalformedURLException malurlex){ Trunk/SpeechSubmission/VFSpeechSubmission/java/src/net/sf/postlet/UploadManager.java
r2245 r2290 79 79 // Output a message explaining that the URL has failed. 80 80 // This should stop all the threads! 81 System.err.println("urlFailure "); 82 81 83 } 82 84 } Trunk/SpeechSubmission/VFSpeechSubmission/java/src/org/voxforge/JavaVersionDisplayApplet.java
r2280 r2290 2 2 import java.applet.*; 3 3 import java.awt.*; 4 public class JavaVersionDisplayApplet extends Applet 5 { private Label m_labVersionVendor; 6 public JavaVersionDisplayApplet() //constructor 7 { Color colFrameBackground = Color.pink; 8 this.setBackground(colFrameBackground); 9 m_labVersionVendor = new Label (" Java Version: " + 4 5 public class JavaVersionDisplayApplet extends Applet { 6 private Label m_labVersionVendor; 7 8 public JavaVersionDisplayApplet() { //constructor 9 Color colFrameBackground = Color.lightGray; 10 this.setBackground(colFrameBackground); 11 m_labVersionVendor = new Label (" Java Version: " + 10 12 System.getProperty("java.version")+ 11 13 " from "+System.getProperty("java.vendor")); 12 this.add(m_labVersionVendor);13 }14 this.add(m_labVersionVendor); 15 } 14 16 } Trunk/SpeechSubmission/VFSpeechSubmission/server/WebGUI/WebGUI-SpeechSubmissionArticle
r2283 r2290 1 <?php2 setcookie("user", "VoxForge", time()+3600);3 if (isset($_COOKIE["user"]))4 echo "Welcome to the " . $_COOKIE["user"] . " Speech Submissions System" . "!<br />";5 else6 echo "Welcome guest!<br />";7 setcookie("user", "VoxForge", time()+3600);8 9 ?>10 <?php11 12 13 $destination = 'http://www.repository.voxforge1.org/SubmitSpeech/javaUploadServer.php';14 $endpage = 'http://www.repository.voxforge1.org/SubmitSpeech/endpage.html';15 $width=600;16 $height=200;17 $isforumpost=false;18 $subject='';19 $filefieldname='userfile';20 $compressionmode=1;21 $compressionmodes='1,2,3';22 global $CFG;23 /* The htmlspecialchars() function converts some predefined characters to HTML entities.*/24 /* $_SERVER is an array containing information such as headers, paths, and script locations. The entries in this array are created by the web server. There is no guarantee that every web server will provide any of these; servers may omit some, or provide others not listed here */25 /* $_COOKIE An associative array of variables passed to the current script via HTTP cookies. Automatically global in any scope. */26 /* $cookie = htmlspecialchars($_SERVER['_COOKIE']); */27 $cookie = ($_COOKIE["user"]);28 /* print ("</br>ken:$cookie</br>"); */29 30 $code = <<<ENDHTMLFRAGMENT31 1 <applet name="Speexuploader" width ="800" height ="800" mayscript="mayscript" 32 2 code="moodlespeex/MoodleSpeexRecorderApplet.class" style="border: 1px solid rgb(153,153,153);"> 33 <param name="archive" value=" moodlespeex.jar"/>3 <param name="archive" value="http://www.repository.voxforge1.org/SubmitSpeech/moodlespeex.jar"/> 34 4 <param name="type" value="application/x-java-applet;version=1.4"/> 35 5 <param name="scriptable" value="true"/> 36 ENDHTMLFRAGMENT; 37 $code .= <<<ENDHTMLFRAGMENT 38 <param name="destination" value="$destination"/> 39 <param name="filefieldname" value=" 40 ENDHTMLFRAGMENT; 41 $code .= htmlspecialchars($filefieldname); 42 $code .= <<<ENDHTMLFRAGMENT 43 "/> 44 <param name="endpage" value="$endpage"/> 45 <param name="cookie" value="$cookie"/> 46 <param name="compressionmode" value="$compressionmode"/> 47 <param name="compressionmodes" value="$compressionmodes"/> 48 The Moodle Speex audio recorder applet should appear here. Please check that you have Java enabled in your web browser - this is 49 required in order to use the audio recorder. 6 <param name="destination" value="http://www.repository.voxforge1.org/SubmitSpeech/javaUploadServer.php"/> 7 <param name="endpage" value="http://www.repository.voxforge1.org/SubmitSpeech/endpage.html"/> 8 <param name="cookie" value="VoxForgeTest"/> 50 9 </applet> 51 ENDHTMLFRAGMENT;52 53 54 echo $code;55 56 ?>Trunk/SpeechSubmission/VFSpeechSubmission/server/submitSpeechServerTest.php
r2284 r2290 30 30 $code = <<<ENDHTMLFRAGMENT 31 31 <applet name="Speexuploader" width ="800" height ="800" mayscript="mayscript" 32 code="moodlespeex/MoodleSpeexRecorderApplet.class" style="border: 1px solid rgb(153,153,153);">32 code="moodlespeex/MoodleSpeexRecorderApplet.class" codebase="http://www.repository.voxforge1.org/SubmitSpeech" style="border: 1px solid rgb(153,153,153);"> 33 33 <param name="archive" value="moodlespeex.jar"/> 34 34 <param name="type" value="application/x-java-applet;version=1.4"/> … … 46 46 <param name="compressionmode" value="$compressionmode"/> 47 47 <param name="compressionmodes" value="$compressionmodes"/> 48 The Moodle Speexaudio recorder applet should appear here. Please check that you have Java enabled in your web browser - this is48 The VoxForge Speech Recognition audio recorder applet should appear here. Please check that you have Java enabled in your web browser - this is 49 49 required in order to use the audio recorder. 50 50 </applet>