voxforge.org
VoxForge Dev

Changeset 2375

Show
Ignore:
Timestamp:
12/28/07 15:47:02 (9 months ago)
Author:
kmaclean
Message:

snapshot for fix to ticket #297

Files:

Legend:

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

    r2374 r2375  
    785785                wavFile = wavFile1;       
    786786                duration = duration1; 
    787                 // !!!!!! 
    788                         System.err.println("play1 totalBytesWritten1:" + totalBytesWritten1); 
    789                 // !!!!!! 
    790787                totalBytesWritten = totalBytesWritten1; 
     788                System.err.println("=== Play1 ===");// !!!!!! 
    791789                playback.start(); 
     790                        System.err.println("duration:" + duration); 
    792791                fileName = promptID1;   
    793792                samplingGraph.start(); 
     
    805804                wavFile = wavFile2;              
    806805                duration = duration2;   
    807                 // !!!!!! 
    808                         System.err.println("play2 totalBytesWritten2:" + totalBytesWritten2); 
    809                 // !!!!!! 
    810806                totalBytesWritten = totalBytesWritten2; 
     807                System.err.println("=== Play2 ===");// !!!!!! 
    811808                playback.start(); 
     809                        System.err.println("duration:" + duration); // !!!!!! 
    812810                fileName = promptID2;  
    813811                samplingGraph.start(); 
     
    825823                wavFile = wavFile3;              
    826824                duration = duration3; 
    827                 // !!!!!! 
    828                         System.err.println("play3 totalBytesWritten3:" + totalBytesWritten3); 
    829                 // !!!!!! 
    830825                totalBytesWritten = totalBytesWritten3; 
     826                System.err.println("=== Play3 ===");// !!!!!! 
    831827                playback.start(); 
     828                        System.err.println("duration:" + duration); // !!!!!! 
    832829                fileName = promptID3;   
    833830                samplingGraph.start(); 
     
    845842                wavFile = wavFile4;              
    846843                duration = duration4; 
    847                 // !!!!!! 
    848                         System.err.println("play4 totalBytesWritten4:" + totalBytesWritten4); 
    849                 // !!!!!! 
    850844                totalBytesWritten = totalBytesWritten4; 
     845                System.err.println("=== Play4 ===");// !!!!!! 
    851846                playback.start(); 
     847                        System.err.println("duration:" + duration); // !!!!!! 
    852848                fileName = promptID4; 
    853849                samplingGraph.start(); 
     
    865861                wavFile = wavFile5;              
    866862                duration = duration5; 
    867                 // !!!!!! 
    868                         System.err.println("play5 totalBytesWritten5:" + totalBytesWritten5); 
    869                 // !!!!!! 
    870863                totalBytesWritten = totalBytesWritten5; 
     864                System.err.println("=== Play5 ===");// !!!!!! 
    871865                playback.start(); 
     866                        System.err.println("duration:" + duration); // !!!!!! 
    872867                fileName = promptID5;   
    873868                samplingGraph.start(); 
     
    886881                duration = duration6; 
    887882                totalBytesWritten = totalBytesWritten6; 
     883                System.err.println("=== Play6 ===");// !!!!!! 
    888884                playback.start(); 
     885                        System.err.println("duration:" + duration); // !!!!!! 
    889886                fileName = promptID6;   
    890887                samplingGraph.start(); 
     
    903900                duration = duration7; 
    904901                totalBytesWritten = totalBytesWritten7; 
     902                System.err.println("=== Play7 ===");// !!!!!! 
    905903                playback.start(); 
     904                        System.err.println("duration:" + duration); // !!!!!! 
    906905                fileName = promptID7; 
    907906                samplingGraph.start(); 
     
    920919                duration = duration8; 
    921920                totalBytesWritten = totalBytesWritten8; 
     921                System.err.println("=== Play8 ===");// !!!!!! 
    922922                playback.start(); 
     923                        System.err.println("duration:" + duration); // !!!!!! 
    923924                fileName = promptID8;    
    924925                samplingGraph.start(); 
     
    937938                duration = duration9; 
    938939                totalBytesWritten = totalBytesWritten9; 
     940                System.err.println("=== Play9 ===");// !!!!!! 
    939941                playback.start(); 
     942                        System.err.println("duration:" + duration); // !!!!!! 
    940943                fileName = promptID9;  
    941944                samplingGraph.start(); 
     
    954957                duration = duration10; 
    955958                totalBytesWritten = totalBytesWritten10; 
     959                System.err.println("=== Play10 ===");// !!!!!! 
    956960                playback.start(); 
     961                        System.err.println("duration:" + duration); // !!!!!! 
    957962                fileName = promptID10; 
    958963                samplingGraph.start(); 
     
    971976            file = null; 
    972977            wavFile = wavFile1;   
    973 //            duration1 = 0; 
     978                System.err.println("=== Record1 ==="); // !!!!!! 
    974979            capture.start(uploadWavFile1);   
    975             duration1 = duration; 
    976980            fileName = promptID1; 
    977981            samplingGraph.start(); 
     
    985989            lines.removeAllElements();   
    986990            capture.stop(); 
    987             totalBytesWritten1 = totalBytesWritten; 
    988991            // !!!!!! 
    989                 System.err.println("capt1 totalBytesWritten1:" + totalBytesWritten1); 
     992            // duration1 = duration; // !!!!!! 
     993            totalBytesWritten1 = totalBytesWritten; // !!!!!! 
     994                duration1 = totalBytesWritten / (double) (format.getSampleRate() * format.getSampleSizeInBits()/ 8); 
     995                System.err.println("duration1:" + duration1); 
    990996            // !!!!!! 
    991             samplingGraph.stop(); 
     997               samplingGraph.stop(); 
    992998            restoreButtonState();  
    993999            play1.setEnabled(true); 
     
    10021008              file = null; 
    10031009              wavFile = wavFile2;  
    1004  //             duration2 = 0; 
     1010              System.err.println("=== Record2 ==="); // !!!!!! 
    10051011              capture.start(uploadWavFile2);  
    1006               duration2 = duration; 
    10071012              fileName = promptID2; 
    10081013              samplingGraph.start(); 
     
    10161021              lines.removeAllElements();   
    10171022              capture.stop(); 
    1018               totalBytesWritten2 = totalBytesWritten; 
    10191023              // !!!!!! 
    1020                   System.err.println("capt2 totalBytesWritten2:" + totalBytesWritten2); 
     1024              // duration2 = duration; // !!!!!! 
     1025              totalBytesWritten2 = totalBytesWritten; // !!!!!! 
     1026              duration2 = totalBytesWritten / (double) (format.getSampleRate() * format.getSampleSizeInBits()/ 8); 
     1027              System.err.println("duration2:" + duration2); 
    10211028              // !!!!!! 
    10221029              samplingGraph.stop(); 
     
    10331040              file = null; 
    10341041              wavFile = wavFile3;  
    1035  //             duration3 = 0; 
     1042              System.err.println("=== Record3 ==="); // !!!!!! 
    10361043              capture.start(uploadWavFile3);    
    1037               duration3 = duration; 
    10381044              fileName = promptID3; 
    10391045              samplingGraph.start(); 
     
    10471053              lines.removeAllElements();   
    10481054              capture.stop(); 
    1049               totalBytesWritten3 = totalBytesWritten; 
    10501055              // !!!!!! 
    1051                   System.err.println("capt3 totalBytesWritten3:" + totalBytesWritten3); 
     1056              // duration3 = duration; // !!!!!! 
     1057              totalBytesWritten3 = totalBytesWritten; // !!!!!! 
     1058              duration3 = totalBytesWritten / (double) (format.getSampleRate() * format.getSampleSizeInBits()/ 8); 
     1059              System.err.println("duration3:" + duration3); 
    10521060              // !!!!!! 
    10531061              samplingGraph.stop(); 
     
    10641072              file = null; 
    10651073              wavFile = wavFile4;      
    1066  //             duration4 = 0; 
     1074              System.err.println("=== Record4 ==="); // !!!!!! 
    10671075              capture.start(uploadWavFile4);  
    1068               duration4 = duration; 
    10691076              fileName = promptID4; 
    10701077              samplingGraph.start(); 
     
    10781085              lines.removeAllElements();   
    10791086              capture.stop(); 
    1080               totalBytesWritten4 = totalBytesWritten; 
    10811087              // !!!!!! 
    1082                   System.err.println("capt4 totalBytesWritten4:" + totalBytesWritten4); 
     1088              // duration4 = duration; // !!!!!! 
     1089              totalBytesWritten4 = totalBytesWritten; // !!!!!! 
     1090              duration4 = totalBytesWritten / (double) (format.getSampleRate() * format.getSampleSizeInBits()/ 8); 
     1091              samplingGraph.stop(); 
     1092                  System.err.println("duration4:" + duration4); 
    10831093              // !!!!!! 
    1084               samplingGraph.stop(); 
    10851094              restoreButtonState();  
    10861095              play4.setEnabled(true); 
     
    10951104              file = null; 
    10961105              wavFile = wavFile5;     
    1097   //            duration5 = 0; 
    1098               capture.start(uploadWavFile5);   
    1099               duration5 = duration; 
     1106              System.err.println("=== Record5 ==="); // !!!!!! 
     1107              capture.start(uploadWavFile5);  
    11001108              fileName = promptID5; 
    11011109              samplingGraph.start(); 
     
    11091117              lines.removeAllElements();   
    11101118              capture.stop(); 
    1111               totalBytesWritten5 = totalBytesWritten; 
    11121119              // !!!!!! 
    1113                   System.err.println("capt5 totalBytesWritten5:" + totalBytesWritten5); 
     1120              // duration5 = duration; // !!!!!! 
     1121              totalBytesWritten5 = totalBytesWritten; // !!!!!! 
     1122              duration5 = totalBytesWritten / (double) (format.getSampleRate() * format.getSampleSizeInBits()/ 8); 
     1123                  System.err.println("duration5:" + duration5); 
    11141124              // !!!!!! 
    11151125              samplingGraph.stop(); 
     
    11261136              file = null; 
    11271137              wavFile = wavFile6;   
    1128  //             duration6 = 0; 
     1138              System.err.println("=== Record6 ===");// !!!!!! 
    11291139              capture.start(uploadWavFile6);   
    1130               totalBytesWritten6 = totalBytesWritten; 
    1131               duration6 = duration; 
    11321140              fileName = promptID6; 
    11331141              samplingGraph.start(); 
     
    11411149              lines.removeAllElements();   
    11421150              capture.stop(); 
     1151              // !!!!!! 
     1152              // duration6 = duration; // !!!!!! 
     1153              totalBytesWritten6 = totalBytesWritten; // !!!!!!        
     1154              duration6 = totalBytesWritten / (double) (format.getSampleRate() * format.getSampleSizeInBits()/ 8); 
     1155              System.err.println("duration6:" + duration6); 
     1156              // !!!!!! 
    11431157              samplingGraph.stop(); 
    11441158              restoreButtonState();  
     
    11541168                file = null; 
    11551169                wavFile = wavFile7;      
    1156  //               duration7 = 0; 
     1170                System.err.println("=== Record7 ===");// !!!!!! 
    11571171                capture.start(uploadWavFile7);   
    1158                 totalBytesWritten7 = totalBytesWritten; 
    1159                 duration7 = duration; 
    11601172                fileName = promptID7; 
    11611173                samplingGraph.start(); 
     
    11691181                lines.removeAllElements();   
    11701182                capture.stop(); 
     1183                // !!!!!! 
     1184                // duration7 = duration; // !!!!!! 
     1185                totalBytesWritten7 = totalBytesWritten; // !!!!!! 
     1186                duration7 = totalBytesWritten / (double) (format.getSampleRate() * format.getSampleSizeInBits()/ 8); 
     1187                System.err.println("duration7:" + duration7); 
     1188                // !!!!!! 
    11711189                samplingGraph.stop(); 
    11721190                restoreButtonState();  
     
    11821200                file = null; 
    11831201                wavFile = wavFile8;   
    1184   //              duration8 = 0; 
     1202                System.err.println("=== Record8 ===");// !!!!!! 
    11851203                capture.start(uploadWavFile8);    
    1186                 totalBytesWritten8 = totalBytesWritten; 
    1187                 duration8 = duration; 
    11881204                fileName = promptID8; 
    11891205                samplingGraph.start(); 
     
    11971213                lines.removeAllElements();   
    11981214                capture.stop(); 
     1215                // !!!!!! 
     1216                // duration8 = duration; // !!!!!! 
     1217                totalBytesWritten8 = totalBytesWritten; // !!!!!! 
     1218                duration8 = totalBytesWritten / (double) (format.getSampleRate() * format.getSampleSizeInBits()/ 8); 
     1219                System.err.println("duration8:" + duration8); 
     1220                // !!!!!! 
    11991221                samplingGraph.stop(); 
    12001222                restoreButtonState();  
     
    12101232                file = null; 
    12111233                wavFile = wavFile9;    
    1212   //              duration9 = 0; 
     1234                System.err.println("=== Record9 ===");// !!!!!! 
    12131235                capture.start(uploadWavFile9);   
    1214                 totalBytesWritten9 = totalBytesWritten; 
    1215                 duration9 = duration; 
    12161236                fileName = promptID9; 
    12171237                samplingGraph.start(); 
     
    12251245                lines.removeAllElements();   
    12261246                capture.stop(); 
     1247                // !!!!!! 
     1248                // duration9 = duration; // !!!!!! 
     1249                totalBytesWritten9 = totalBytesWritten; // !!!!!! 
     1250                duration9 = totalBytesWritten / (double) (format.getSampleRate() * format.getSampleSizeInBits()/ 8); 
     1251                System.err.println("duration9:" + duration9); 
     1252                // !!!!!! 
    12271253                samplingGraph.stop(); 
    12281254                restoreButtonState();  
     
    12381264                file = null; 
    12391265                wavFile = wavFile10;     
    1240   //              duration10 = 0; 
     1266                System.err.println("=== Record10 ===");// !!!!!! 
    12411267                capture.start(uploadWavFile10);  
    1242                 totalBytesWritten10 = totalBytesWritten; 
    1243                 duration10 = duration; 
    12441268                fileName = promptID10; 
    12451269                samplingGraph.start(); 
     
    12531277                lines.removeAllElements();   
    12541278                capture.stop(); 
     1279                // !!!!!! 
     1280                // duration10 = duration; // !!!!!! 
     1281                totalBytesWritten10 = totalBytesWritten; // !!!!!! 
     1282                duration10 = totalBytesWritten / (double) (format.getSampleRate() * format.getSampleSizeInBits()/ 8); 
     1283                System.err.println("duration10:" + duration10); 
     1284                // !!!!!! 
    12551285                samplingGraph.stop(); 
    12561286                restoreButtonState();  
     
    13441374                long milliseconds = (long)((audioInputStream.getFrameLength() * 1000) / audioInputStream.getFormat().getFrameRate()); 
    13451375                duration = milliseconds / 1000.0; 
     1376                // !!!!!! 
     1377                        System.err.println("createAudioInputStream duration:" + duration); 
     1378                // !!!!!! 
    13461379                if (updateComponents) { 
    13471380//DEL                    formatControls.setFormat(audioInputStream.getFormat()); 
     
    14261459 
    14271460        public void start() { 
    1428                 // !!!!!! 
    1429                 System.err.println("=== Play ========================================================="); 
    1430                 // !!!!!! 
    1431   
    14321461            errStr = null; 
    14331462            thread = new Thread(this); 
     
    14841513        public void run() { 
    14851514            // reload the file if loaded by file 
    1486             if (file != null) { 
     1515   /* !!!!!!        if (file != null) { 
    14871516                createAudioInputStream(file, false); 
     1517                // !!!!!! 
     1518                        System.err.println("playback ...createAudioInputStream file:" + file); 
     1519                // !!!!!! 
    14881520            } 
    14891521 
     
    14931525                return; 
    14941526            } 
     1527  !!!!!! */ 
    14951528            // reset to the beginning of the stream 
    14961529 
     
    15581591            byte audioBytes[] = outbaos.toByteArray(); 
    15591592            // !!!!!! 
    1560                 System.err.println("outbaos size:" + outbaos.size());             
     1593                // debug System.err.println("outbaos size:" + outbaos.size());             
    15611594                outbaos.reset(); 
    15621595                outbaos = null; 
     
    16221655        public void start(File uploadWavFile) { 
    16231656                this.uploadWavFile = uploadWavFile;  
    1624                 // !!!!!! 
    1625                 System.err.println("== Capture ========================================================="); 
    1626                 // !!!!!! 
    16271657                System.err.println("Capture uploadWavFile is:" + uploadWavFile); 
    16281658 
     
    17361766            // load bytes into the audio input stream for playback 
    17371767            getAudioInputStream(); 
    1738  
    1739                 System.err.println("Capture.run uploadWavFile is:" + uploadWavFile); 
    1740                  
     1768         
    17411769 //           saveToFile(this.uploadWavFile, AudioFileFormat.Type.WAVE); 
    17421770            try { 
     
    17491777         
    17501778                duration = totalBytesWritten / (double) (format.getSampleRate() * format.getSampleSizeInBits()/ 8); 
     1779            // !!!!!! 
     1780                System.err.println("capture duration:" + duration); 
     1781            // !!!!!! 
    17511782                // debug        System.err.println("Calculated duration"); 
    17521783            samplingGraph.createWaveForm(audioBytes); 
     
    17721803                        } 
    17731804                } 
    1774 // !!!!!! 
    1775                 System.err.println("getAudioInputStream - totalBytesWritten:" + totalBytesWritten); 
    1776 // !!!!!! 
     1805                // debug System.err.println("getAudioInputStream - totalBytesWritten:" + totalBytesWritten); 
    17771806                try { 
    17781807                        //              audioInputStream = AudioSystem.getAudioInputStream(wavFile); 
     
    18021831            thread = new Thread(this); 
    18031832            thread.setName("ConvertAndUpload"); 
     1833                // !!!!!! 
     1834                System.err.println("=== Upload ==="); 
     1835                // !!!!!! 
    18041836            thread.start(); 
    18051837        } 
     
    19401972                         
    19411973                        if (userName != null){ 
    1942                                 archiveFile = new File(tempdir + userName + "-" + date + "-" + randomID + ".zip"); 
     1974                                archiveFile = new File(tempdir + language + "-" + userName + "-" + date + "-" + randomID + ".zip"); 
    19431975                        } else { 
    1944                                 archiveFile = new File(tempdir +"Anonymous-" + date + "-" + randomID + ".zip"); 
     1976                                archiveFile = new File(tempdir + language + "-" + "Anonymous-" + date + "-" + randomID + ".zip"); 
    19451977                        } 
    19461978                         
  • Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/LICENSE

    r2320 r2375  
    1515   Java code from other projects: 
    1616    - MoodleSpeex, (c) Dan Stowell 2006. 
    17     - JSpeex player/recorder, (c) Wimba S.A. 
    1817    - Postlet HTTP uploader,  (c) Simon Rycroft 
    1918    - JavaSoundDemo,          (c) Sun Microsystems 
  • Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/License.java

    r2366 r2375  
    4848                 
    4949                VFlicenseNotice =   
    50                   "VoxForge Speech Submission Application v0.1.1" + System.getProperty("line.separator") 
     50                  "VoxForge Speech Submission Application v0.1.2" + System.getProperty("line.separator") 
    5151                + "============================" + System.getProperty("line.separator") 
    5252                + "Allows a user to record their speech and upload it to the VoxForge server" + System.getProperty("line.separator")  
     
    7676                + "from other projects:"+ System.getProperty("line.separator") 
    7777                + "   - MoodleSpeex, (c) Dan Stowell 2006."+ System.getProperty("line.separator") 
    78                 + "   - JSpeex player/recorder, (c) Wimba S.A."+ System.getProperty("line.separator") 
    7978                + "   - Postlet HTTP uploader,  (c) Simon Rycroft"+ System.getProperty("line.separator") 
    8079                + "   - JavaSoundDemo,          (c) Sun Microsystems"+ System.getProperty("line.separator")