voxforge.org
VoxForge Dev

Changeset 2258

Show
Ignore:
Timestamp:
08/14/07 21:32:52 (1 year ago)
Author:
kmaclean
Message:

VF Speech Submission - file names now appear when recording or playing a file

Files:

Legend:

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

    r2257 r2258  
    661661        prompt10InnerPanel.add(new JLabel(this.prompt10)); 
    662662        prompt10Panel.add(prompt10InnerPanel); 
    663         play5 = addButton("Play", prompt10Panel, false); 
    664         capt5 = addButton("Record", prompt10Panel, true); 
     663        play10 = addButton("Play", prompt10Panel, false); 
     664        capt10 = addButton("Record", prompt10Panel, true); 
    665665        prompts.add(prompt10Panel);  
    666666        promptsContainer.add(prompts); 
     
    757757                wavFile = wavFile1;  // !!!!!!                   
    758758                playback.start(); 
     759                fileName = promptID1;                 
    759760                samplingGraph.start(); 
    760761                capt1.setEnabled(false); 
     
    771772                wavFile = wavFile2;  // !!!!!!                   
    772773                playback.start(); 
     774                fileName = promptID2;                    
    773775                samplingGraph.start(); 
    774776                capt2.setEnabled(false); 
     
    785787                wavFile = wavFile3;  // !!!!!!                   
    786788                playback.start(); 
     789                fileName = promptID3;                   
    787790                samplingGraph.start(); 
    788791                capt3.setEnabled(false); 
     
    799802                wavFile = wavFile4;  // !!!!!!                   
    800803                playback.start(); 
     804                fileName = promptID4;                   
    801805                samplingGraph.start(); 
    802806                capt4.setEnabled(false); 
     
    813817                wavFile = wavFile5;  // !!!!!!                   
    814818                playback.start(); 
     819                fileName = promptID5;   
    815820                samplingGraph.start(); 
    816821                capt5.setEnabled(false); 
     
    827832                wavFile = wavFile6;  // !!!!!!                   
    828833                playback.start(); 
     834                fileName = promptID6;   
    829835                samplingGraph.start(); 
    830836                capt6.setEnabled(false); 
     
    841847                wavFile = wavFile7;  // !!!!!!                   
    842848                playback.start(); 
     849                fileName = promptID7; 
    843850                samplingGraph.start(); 
    844851                capt7.setEnabled(false); 
     
    855862                wavFile = wavFile8;  // !!!!!!                   
    856863                playback.start(); 
     864                fileName = promptID8;     
    857865                samplingGraph.start(); 
    858866                capt8.setEnabled(false); 
     
    869877                wavFile = wavFile9;  // !!!!!!                   
    870878                playback.start(); 
     879                fileName = promptID9;  
    871880                samplingGraph.start(); 
    872881                capt9.setEnabled(false); 
     
    883892                wavFile = wavFile10;  // !!!!!!                  
    884893                playback.start(); 
     894                fileName = promptID10; 
    885895                samplingGraph.start(); 
    886896                capt10.setEnabled(false); 
     
    931941            wavFile = wavFile1;   
    932942            capture.start(uploadWavFile1);    
    933             fileName = "untitled"
     943            fileName = promptID1
    934944            samplingGraph.start(); 
    935945            play1.setEnabled(false); 
     
    950960              wavFile = wavFile2;  // !!!!!!               
    951961              capture.start(uploadWavFile2);    
    952               fileName = "untitled"
     962              fileName = promptID2
    953963              samplingGraph.start(); 
    954964              play2.setEnabled(false); 
     
    969979              wavFile = wavFile3;  // !!!!!!    
    970980              capture.start(uploadWavFile3);    
    971               fileName = "untitled"
     981              fileName = promptID3
    972982              samplingGraph.start(); 
    973983              play3.setEnabled(false); 
     
    988998              wavFile = wavFile4;  // !!!!!!               
    989999              capture.start(uploadWavFile4);    
    990               fileName = "untitled"
     1000              fileName = promptID4
    9911001              samplingGraph.start(); 
    9921002              play4.setEnabled(false); 
     
    10071017              wavFile = wavFile5;  // !!!!!!               
    10081018              capture.start(uploadWavFile5);    
    1009               fileName = "untitled"
     1019              fileName = promptID5
    10101020              samplingGraph.start(); 
    10111021              play5.setEnabled(false); 
     
    10261036              wavFile = wavFile6;   
    10271037              capture.start(uploadWavFile6);    
    1028               fileName = "untitled"
     1038              fileName = promptID6
    10291039              samplingGraph.start(); 
    10301040              play6.setEnabled(false); 
     
    10451055                wavFile = wavFile7;  // !!!!!!               
    10461056                capture.start(uploadWavFile7);    
    1047                 fileName = "untitled"
     1057                fileName = promptID7
    10481058                samplingGraph.start(); 
    10491059                play7.setEnabled(false); 
     
    10641074                wavFile = wavFile8;  // !!!!!!    
    10651075                capture.start(uploadWavFile8);    
    1066                 fileName = "untitled"
     1076                fileName = promptID8
    10671077                samplingGraph.start(); 
    10681078                play8.setEnabled(false); 
     
    10831093                wavFile = wavFile9;  // !!!!!!               
    10841094                capture.start(uploadWavFile9);    
    1085                 fileName = "untitled"
     1095                fileName = promptID9
    10861096                samplingGraph.start(); 
    10871097                play9.setEnabled(false); 
     
    11021112                wavFile = wavFile10;  // !!!!!!               
    11031113                capture.start(uploadWavFile10);    
    1104                 fileName = "untitled"
     1114                fileName = promptID10
    11051115                samplingGraph.start(); 
    11061116                play10.setEnabled(false); 
     
    13501360              play4.setText("Play"); 
    13511361              capt5.setEnabled(true); 
    1352               play5.setText("Play");               
     1362              play5.setText("Play");      
     1363              capt6.setEnabled(true); 
     1364              play6.setText("Play"); 
     1365              capt7.setEnabled(true); 
     1366              play7.setText("Play"); 
     1367              capt8.setEnabled(true); 
     1368              play8.setText("Play"); 
     1369              capt9.setEnabled(true); 
     1370              play9.setText("Play"); 
     1371              capt10.setEnabled(true); 
     1372              play10.setText("Play");  
    13531373//              !!!!!!                 
    13541374            }  
     
    21522172                                                         } 
    21532173                                                 } 
    2154                                          } else if (format.getSampleSizeInBits() == 8) { 
     2174                                         }  
     2175// !!!!!! 
     2176                                        else if (format.getSampleSizeInBits() == 48) { 
     2177                                                 buflengthinsamples = bytesread / 6; 
     2178//              System.err.println("Debug point 1.1"); 
     2179                //                 audioData = new int[nlengthInSamples]; 
     2180//              System.err.println("Debug point 1.2"); 
     2181                                                 if (format.isBigEndian()) { 
     2182                                                        for (int i = 0; i < buflengthinsamples; i++) { 
     2183                                                                 /* First byte is MSB (high order) */ 
     2184                                                                 int MSB = (int) readbuf[2*i]; 
     2185                                                                 /* Second byte is LSB (low order) */ 
     2186                                                                 int LSB = (int) readbuf[2*i+1]; 
     2187                                                                 audioDatum = MSB << 8 | (255 & LSB); 
     2188                                                                 if(audioDatum > peakThresh) { 
     2189                                                                         numPeakValues++; 
     2190                                                                 } 
     2191                                                                 if((i % frames_per_pixel) == 0){ 
     2192                                                                         my_byte = (byte)(128 * audioDatum / 32768); 
     2193                                                                         double y_new = (double) (h * (128 - my_byte) / 256); 
     2194                                                                         int x = i / frames_per_pixel; 
     2195                                                                         lines.add(new Line2D.Double(x, y_last, x, y_new)); 
     2196                                                                         y_last = y_new; 
     2197                                                                 } 
     2198                //                         audioData[i] = audioDatum; 
     2199                                                         } 
     2200                                                 } else { 
     2201                                                         for (int i = 0; i < buflengthinsamples; i++) { 
     2202                                                                 /* First byte is LSB (low order) */ 
     2203                                                                 int LSB = (int) readbuf[2*i]; 
     2204                                                                 /* Second byte is MSB (high order) */ 
     2205                                                                 int MSB = (int) readbuf[2*i+1]; 
     2206                                                                 audioDatum = MSB << 8 | (255 & LSB); 
     2207                                                                 if(audioDatum > peakThresh) { 
     2208                                                                         numPeakValues++; 
     2209                                                                 } 
     2210                                                                 if((i % frames_per_pixel) == 0){ 
     2211                                                                         my_byte = (byte)(128 * audioDatum / 32768); 
     2212                                                                         double y_new = (double) (h * (128 - my_byte) / 256); 
     2213                                                                         int x = i / frames_per_pixel; 
     2214                                                                         lines.add(new Line2D.Double(x, y_last, x, y_new)); 
     2215                                                                         y_last = y_new; 
     2216                                                                 } 
     2217                //                         audioData[i] = audioDatum; 
     2218                                                         } 
     2219                                                 } 
     2220                                         }                       
     2221// !!!!!!                                        
     2222                                         
     2223                                        else if (format.getSampleSizeInBits() == 8) { 
    21552224                                                 buflengthinsamples = bytesread; 
    21562225//              System.err.println("Debug point 2.1"); 
  • Trunk/SpeechSubmission/VFSpeechSubmission/server/javaUpload.php

    r2256 r2258  
    3030// extensions to ALLOW, or DENY 
    3131$allow_or_deny_method = "allow"; // "allow" or "deny" 
    32 $file_extension_list = array("php","asp","pl"); 
     32$file_extension_list = array("zip"); 
    3333// ----------------------------------------------------------------------------- 
    3434if ($allow_or_deny){