voxforge.org
VoxForge Dev

Changeset 2519

Show
Ignore:
Timestamp:
03/31/08 23:07:23 (6 months ago)
Author:
kmaclean
Message:

speech submission app snapshot

Files:

Legend:

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

    • Property svn:ignore changed from
      CapturePlayback.java-bak
      to
      CapturePlayback.java-bak
      TabbedPaneDemo.java
  • Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/CapturePlayback.java

    r2515 r2519  
    8888 
    8989    // int numberofPrompts = 5; 
    90     int numberofPrompts = 40; 
     90    int numberofPrompts = 10; 
    9191    JButton [] playA = new JButton [numberofPrompts]; //creates the array, not the objects! 
    9292    JButton [] captA = new JButton [numberofPrompts]; //creates the array, not the objects! 
     
    206206        URL endPageURL, URL helpPageURL, String cookie) {        
    207207//  ############ Localized Fields ####################################    
    208         //this.language = language; 
     208        this.language = language; 
    209209        //this.language = "RU"; //test 
    210         this.language = "EN"; //test 
    211         // debug System.err.println("CapturePlayback Language:" + this.language + ":"); 
     210        //this.language = "RU"; //test 
     211        System.err.println("CapturePlayback Language:" + this.language + ":"); // debug 
    212212 
    213213    LabelLocalizer labels = new LabelLocalizer(this.language); 
     
    267267        this.promptidA [i] = promptArray[0][i]; 
    268268        this.promptA [i] = promptArray[1][i]; 
    269         System.err.println("Prompts:" + this.promptidA[i] + ":"+ this.promptA [i]); 
     269        // System.err.println("Prompts:" + this.promptidA[i] + ":"+ this.promptA [i]); 
    270270    } 
    271271    
     
    372372        promptsContainer.setLayout(new FlowLayout(FlowLayout.CENTER)); 
    373373        Color voxforgeColour    = new Color(197, 216, 234); 
    374         // assume 40 prompts 
    375         int startPromptCount = 0; 
    376         int promptsPerPane = 10; 
     374         int startPromptCount = 0; 
     375        // !!!!!! 
     376        //int promptsPerPane = 10; 
     377        int promptsPerPane = numberofPrompts; 
     378        // !!!!!! 
    377379//      ############ Prompts panel ####################################          
    378380        JPanel prompts = new JPanel();  
     
    406408        promptsContainer.add(prompts); 
    407409        p2.add(promptsContainer); 
    408  
    409          
    410410 
    411411//      ############ Sampling Graph ####################################           
     
    446446//#########################################################################    
    447447         add(p2); 
    448  
    449448    } 
    450449 
     
    469468    public void close() { 
    470469        if (playback.thread != null) { 
    471                 // !!!!!! 
    472470            for (int i = 0; i < numberofPrompts; i++) { 
    473471                playA[i].doClick(0); 
    474472            } 
    475             /* 
    476             play1.doClick(0); 
    477             play2.doClick(0); 
    478             play3.doClick(0); 
    479             play4.doClick(0); 
    480             play5.doClick(0); 
    481             play6.doClick(0); 
    482             play7.doClick(0); 
    483             play8.doClick(0); 
    484             play9.doClick(0); 
    485             play10.doClick(0); 
    486             !!!!!! */ 
    487473        } 
    488474        if (capture.thread != null) { 
    489                 // !!!!!! 
    490475            for (int i = 0; i < numberofPrompts; i++) { 
    491476                captA[i].doClick(0); 
    492477            } 
    493             /* 
    494             capt1.doClick(0);  
    495             capt2.doClick(0); 
    496             capt3.doClick(0);    
    497             capt4.doClick(0); 
    498             capt5.doClick(0);    
    499             capt6.doClick(0); 
    500             capt7.doClick(0);    
    501             capt8.doClick(0); 
    502             capt9.doClick(0);    
    503             capt10.doClick(0); 
    504             !!!!!! */ 
    505478        } 
    506479    } 
     
    510483        b.addActionListener(this); 
    511484        p.add(b); 
    512         // !!!!!! 
    513485        b.setEnabled(state); 
    514         // !!!!!! 
    515486        return b; 
    516487    } 
    517488     
    518489    private void setButtonsOff() { 
    519         // !!!!!! 
    520490        for (int i = 0; i < numberofPrompts; i++) { 
    521491                playA[i].setEnabled(false);  
     
    523493            //System.err.println("setButtonsOff" + "playA" + i + playA[i].isEnabled()+ ";captA" + i + captA[i].isEnabled());// !!!!!! 
    524494        } 
    525         /* 
    526         play1.setEnabled(false);  
    527         capt1.setEnabled(false);  
    528         play2.setEnabled(false);  
    529         capt2.setEnabled(false);  
    530         play3.setEnabled(false);  
    531         capt3.setEnabled(false);  
    532         play4.setEnabled(false);  
    533         capt4.setEnabled(false);  
    534         play5.setEnabled(false);  
    535         capt5.setEnabled(false);  
    536         play6.setEnabled(false);  
    537         capt6.setEnabled(false);  
    538         play7.setEnabled(false);  
    539         capt7.setEnabled(false);  
    540         play8.setEnabled(false);  
    541         capt8.setEnabled(false);  
    542         play9.setEnabled(false);  
    543         capt9.setEnabled(false);  
    544         play10.setEnabled(false);  
    545         capt10.setEnabled(false);  
    546         !!!!!! */ 
    547495    } 
    548496     
    549497    private void saveButtonState() { 
    550         // !!!!!! 
    551498        for (int i = 0; i < numberofPrompts; i++) { 
     499                // System.err.println("playA[i]" +  i ); // !!!!!! 
    552500                if (playA[i].isEnabled()) {play_stateA [i] = true;} else {play_stateA [i] = false;} 
    553501                if (captA[i].isEnabled()) {capt_stateA [i] = true;} else {capt_stateA [i] = false;} 
    554502            //System.err.println("saveButtonState" + "playA" + i + playA[i].isEnabled()+ ";captA" + i + captA[i].isEnabled());// !!!!!! 
    555503        } 
    556         /* 
    557         if (play1.isEnabled()) {play1_state = true;} else {play1_state = false;} 
    558         if (play2.isEnabled()) {play2_state = true;} else {play2_state = false;}   
    559         if (play3.isEnabled()) {play3_state = true;} else {play3_state = false;} 
    560         if (play4.isEnabled()) {play4_state = true;} else {play4_state = false;}         
    561         if (play5.isEnabled()) {play5_state = true;} else {play5_state = false;} 
    562         if (play6.isEnabled()) {play6_state = true;} else {play6_state = false;}         
    563         if (play7.isEnabled()) {play7_state = true;} else {play7_state = false;} 
    564         if (play8.isEnabled()) {play8_state = true;} else {play8_state = false;}         
    565         if (play9.isEnabled()) {play9_state = true;} else {play9_state = false;} 
    566         if (play10.isEnabled()) {play10_state = true;} else {play10_state = false;}      
    567         if (capt1.isEnabled()) {capt1_state = true;} else {capt1_state = false;} 
    568         if (capt2.isEnabled()) {capt2_state = true;} else {capt2_state = false;}   
    569         if (capt3.isEnabled()) {capt3_state = true;} else {capt3_state = false;} 
    570         if (capt4.isEnabled()) {capt4_state = true;} else {capt4_state = false;}         
    571         if (capt5.isEnabled()) {capt5_state = true;} else {capt5_state = false;} 
    572         if (capt6.isEnabled()) {capt6_state = true;} else {capt6_state = false;}         
    573         if (capt7.isEnabled()) {capt7_state = true;} else {capt7_state = false;} 
    574         if (capt8.isEnabled()) {capt8_state = true;} else {capt8_state = false;}         
    575         if (capt9.isEnabled()) {capt9_state = true;} else {capt9_state = false;} 
    576         if (capt10.isEnabled()) {capt10_state = true;} else {capt10_state = false;} 
    577         !!!!!! */ 
    578504    } 
    579505     
    580506    private void restoreButtonState() { 
    581         // !!!!!! 
    582507        for (int i = 0; i < numberofPrompts; i++) { 
    583508                if (play_stateA[i]) {playA[i].setEnabled(true);} else {playA[i].setEnabled(false);} 
     
    585510            // System.err.println("restoreButtonState" + "playA" + i + playA[i].isEnabled()+ ";captA" + i + captA[i].isEnabled());// !!!!!! 
    586511        } 
    587         /* 
    588         if (play1_state) {play1.setEnabled(true);} else {play1.setEnabled(false);} 
    589         if (play2_state) {play2.setEnabled(true);} else {play2.setEnabled(false);} 
    590         if (play3_state) {play3.setEnabled(true);} else {play3.setEnabled(false);} 
    591         if (play4_state) {play4.setEnabled(true);} else {play4.setEnabled(false);} 
    592         if (play5_state) {play5.setEnabled(true);} else {play5.setEnabled(false);} 
    593         if (play6_state) {play6.setEnabled(true);} else {play6.setEnabled(false);} 
    594         if (play7_state) {play7.setEnabled(true);} else {play7.setEnabled(false);} 
    595         if (play8_state) {play8.setEnabled(true);} else {play8.setEnabled(false);} 
    596         if (play9_state) {play9.setEnabled(true);} else {play9.setEnabled(false);} 
    597         if (play10_state) {play10.setEnabled(true);} else {play10.setEnabled(false);}  
    598         if (capt1_state) {capt1.setEnabled(true);} else {capt1.setEnabled(false);} 
    599         if (capt2_state) {capt2.setEnabled(true);} else {capt2.setEnabled(false);} 
    600         if (capt3_state) {capt3.setEnabled(true);} else {capt3.setEnabled(false);} 
    601         if (capt4_state) {capt4.setEnabled(true);} else {capt4.setEnabled(false);} 
    602         if (capt5_state) {capt5.setEnabled(true);} else {capt5.setEnabled(false);} 
    603         if (capt6_state) {capt6.setEnabled(true);} else {capt6.setEnabled(false);} 
    604         if (capt7_state) {capt7.setEnabled(true);} else {capt7.setEnabled(false);} 
    605         if (capt8_state) {capt8.setEnabled(true);} else {capt8.setEnabled(false);} 
    606         if (capt9_state) {capt9.setEnabled(true);} else {capt9.setEnabled(false);} 
    607         if (capt10_state) {capt10.setEnabled(true);} else {capt10.setEnabled(false);} 
    608         !!!!!! */  
    609512    } 
    610513    // !!!!!! 
    611     public boolean equals(Object obj) { 
     514    /* public boolean equals(Object obj) { 
    612515        for (int i = 0; i < numberofPrompts; i++) { 
    613516            if (obj.equals(playA[i])) { 
     
    616519        } 
    617520        return (this == obj); 
    618         } 
     521        } */ 
    619522    // !!!!!! 
    620523    public void actionPerformed(ActionEvent e) { 
     
    624527        // !!!!!! 
    625528        for (int i = 0; i < numberofPrompts; i++) { 
     529                //System.err.println("playA[i]" +  i ); // !!!!!! 
    626530            if (obj.equals(playA[i])) { 
    627531                if (playA[i].getText().startsWith(playButton)) { 
     
    629533                    duration = durationA[i]; 
    630534                    totalBytesWritten = totalBytesWrittenA[i]; 
    631                     System.err.println("=== Play" + i + "===");// !!!!!! 
     535                    System.err.println("=== Play " + (i+1) + " ===");// !!!!!! 
    632536                    playback.start(); 
    633537                        System.err.println("duration:" + duration); 
    634538                    fileName = promptidA[i];   
    635539                    samplingGraph.start(); 
    636                     // !!!!!! 
    637540                        saveButtonState();  
    638541                        setButtonsOff(); 
     
    640543                    playA[i].setEnabled(true); 
    641544                    playA[i].setText(stopButton); 
    642                         // !!!!!! 
    643545                } else { 
    644546                    playback.stop(); 
    645547                    samplingGraph.stop(); 
    646                     // !!!!!! 
    647548                        restoreButtonState();  
    648                         // !!!!!! 
    649549                    captA[i].setEnabled(true); 
    650550                    playA[i].setText(playButton); 
     
    658558                        file = null; 
    659559                        wavFile = wavFileA[x];   
    660                                 System.err.println("=== Record" + x + "==="); // !!!!!! 
     560                                System.err.println("=== Record " + (x+1) + " ==="); // !!!!!! 
    661561                        capture.start(uploadWavFileA[x]);   
    662562                        fileName = promptidA[x]; 
     
    690590                }  
    691591            } 
    692       /*  
    693        if (obj.equals(play1)) { 
    694             if (play1.getText().startsWith(playButton)) { 
    695                 wavFile = wavFile1;       
    696                 duration = duration1; 
    697                 totalBytesWritten = totalBytesWritten1; 
    698                 System.err.println("=== Play1 ===");// !!!!!! 
    699                 playback.start(); 
    700                         System.err.println("duration:" + duration); 
    701                 fileName = promptID1;   
    702                 samplingGraph.start(); 
    703                 capt1.setEnabled(false); 
    704                 play1.setText(stopButton); 
    705             } else { 
    706                 playback.stop(); 
    707                 samplingGraph.stop(); 
    708                 capt1.setEnabled(true); 
    709                 play1.setText(playButton); 
    710             } 
    711         }    
    712         else if (obj.equals(play2)) { 
    713             if (play2.getText().startsWith(playButton)) { 
    714                 wavFile = wavFile2;              
    715                 duration = duration2;   
    716                 totalBytesWritten = totalBytesWritten2; 
    717                 System.err.println("=== Play2 ===");// !!!!!! 
    718                 playback.start(); 
    719                         System.err.println("duration:" + duration); // !!!!!! 
    720                 fileName = promptID2;  
    721                 samplingGraph.start(); 
    722                 capt2.setEnabled(false); 
    723                 play2.setText(stopButton); 
    724             } else { 
    725                 playback.stop(); 
    726                 samplingGraph.stop(); 
    727                 capt2.setEnabled(true); 
    728                 play2.setText(playButton); 
    729             } 
    730         }     
    731         else if (obj.equals(play3)) { 
    732             if (play3.getText().startsWith(playButton)) { 
    733                 wavFile = wavFile3;              
    734                 duration = duration3; 
    735                 totalBytesWritten = totalBytesWritten3; 
    736                 System.err.println("=== Play3 ===");// !!!!!! 
    737                 playback.start(); 
    738                         System.err.println("duration:" + duration); // !!!!!! 
    739                 fileName = promptID3;   
    740                 samplingGraph.start(); 
    741                 capt3.setEnabled(false); 
    742                 play3.setText(stopButton); 
    743             } else { 
    744                 playback.stop(); 
    745                 samplingGraph.stop(); 
    746                 capt3.setEnabled(true); 
    747                 play3.setText(playButton); 
    748             } 
    749         }    
    750         else if (obj.equals(play4)) { 
    751             if (play4.getText().startsWith(playButton)) { 
    752                 wavFile = wavFile4;              
    753                 duration = duration4; 
    754                 totalBytesWritten = totalBytesWritten4; 
    755                 System.err.println("=== Play4 ===");// !!!!!! 
    756                 playback.start(); 
    757                         System.err.println("duration:" + duration); // !!!!!! 
    758                 fileName = promptID4; 
    759                 samplingGraph.start(); 
    760                 capt4.setEnabled(false); 
    761                 play4.setText(stopButton); 
    762             } else { 
    763                 playback.stop(); 
    764                 samplingGraph.stop(); 
    765                 capt4.setEnabled(true); 
    766                 play4.setText(playButton); 
    767             } 
    768         }    
    769         else if (obj.equals(play5)) { 
    770             if (play5.getText().startsWith(playButton)) { 
    771                 wavFile = wavFile5;              
    772                 duration = duration5; 
    773                 totalBytesWritten = totalBytesWritten5; 
    774                 System.err.println("=== Play5 ===");// !!!!!! 
    775                 playback.start(); 
    776                         System.err.println("duration:" + duration); // !!!!!! 
    777                 fileName = promptID5;   
    778                 samplingGraph.start(); 
    779                 capt5.setEnabled(false); 
    780                 play5.setText(stopButton); 
    781             } else { 
    782                 playback.stop(); 
    783                 samplingGraph.stop(); 
    784                 capt5.setEnabled(true); 
    785                 play5.setText(playButton); 
    786             } 
    787         }      
    788         else if (obj.equals(play6)) { 
    789             if (play6.getText().startsWith(playButton)) { 
    790                 wavFile = wavFile6;              
    791                 duration = duration6; 
    792                 totalBytesWritten = totalBytesWritten6; 
    793                 System.err.println("=== Play6 ===");// !!!!!! 
    794                 playback.start(); 
    795                         System.err.println("duration:" + duration); // !!!!!! 
    796                 fileName = promptID6;   
    797                 samplingGraph.start(); 
    798                 capt6.setEnabled(false); 
    799                 play6.setText(stopButton); 
    800             } else { 
    801                 playback.stop(); 
    802                 samplingGraph.stop(); 
    803                 capt6.setEnabled(true); 
    804                 play6.setText(playButton); 
    805             } 
    806         }    
    807         else if (obj.equals(play7)) { 
    808             if (play7.getText().startsWith(playButton)) { 
    809                 wavFile = wavFile7;              
    810                 duration = duration7; 
    811                 totalBytesWritten = totalBytesWritten7; 
    812                 System.err.println("=== Play7 ===");// !!!!!! 
    813                 playback.start(); 
    814                         System.err.println("duration:" + duration); // !!!!!! 
    815                 fileName = promptID7; 
    816                 samplingGraph.start(); 
    817                 capt7.setEnabled(false); 
    818                 play7.setText(stopButton); 
    819             } else { 
    820                 playback.stop(); 
    821                 samplingGraph.stop(); 
    822                 capt7.setEnabled(true); 
    823                 play7.setText(playButton); 
    824             } 
    825         }     
    826         else if (obj.equals(play8)) { 
    827             if (play8.getText().startsWith(playButton)) { 
    828                 wavFile = wavFile8;              
    829                 duration = duration8; 
    830                 totalBytesWritten = totalBytesWritten8; 
    831                 System.err.println("=== Play8 ===");// !!!!!! 
    832                 playback.start(); 
    833                         System.err.println("duration:" + duration); // !!!!!! 
    834                 fileName = promptID8;    
    835                 samplingGraph.start(); 
    836                 capt8.setEnabled(false); 
    837                 play8.setText(stopButton); 
    838             } else { 
    839                 playback.stop(); 
    840                 samplingGraph.stop(); 
    841                 capt8.setEnabled(true); 
    842                 play8.setText(playButton); 
    843             } 
    844         }    
    845         else if (obj.equals(play9)) { 
    846             if (play9.getText().startsWith(playButton)) { 
    847                 wavFile = wavFile9;                      
    848                 duration = duration9; 
    849                 totalBytesWritten = totalBytesWritten9; 
    850                 System.err.println("=== Play9 ===");// !!!!!! 
    851                 playback.start(); 
    852                         System.err.println("duration:" + duration); // !!!!!! 
    853                 fileName = promptID9;  
    854                 samplingGraph.start(); 
    855                 capt9.setEnabled(false); 
    856                 play9.setText(stopButton); 
    857             } else { 
    858                 playback.stop(); 
    859                 samplingGraph.stop(); 
    860                 capt9.setEnabled(true); 
    861                 play9.setText(playButton); 
    862             } 
    863         }    
    864         else if (obj.equals(play10)) { 
    865             if (play10.getText().startsWith(playButton)) { 
    866                 wavFile = wavFile10;                     
    867                 duration = duration10; 
    868                 totalBytesWritten = totalBytesWritten10; 
    869                 System.err.println("=== Play10 ===");// !!!!!! 
    870                 playback.start(); 
    871                         System.err.println("duration:" + duration); // !!!!!! 
    872                 fileName = promptID10; 
    873                 samplingGraph.start(); 
    874                 capt10.setEnabled(false); 
    875                 play10.setText(stopButton); 
    876             } else { 
    877                 playback.stop(); 
    878                 samplingGraph.stop(); 
    879                 capt10.setEnabled(true); 
    880                 play10.setText(playButton); 
    881             } 
    882         }            
    883  
    884 // ################### Record #######################################      
    885       else if (obj.equals(capt1)) { 
    886         if (capt1.getText().startsWith(recordButton)) { 
    887             file = null; 
    888             wavFile = wavFile1;   
    889                 System.err.println("=== Record1 ==="); // !!!!!! 
    890             capture.start(uploadWavFile1);   
    891             fileName = promptID1; 
    892             samplingGraph.start(); 
    893             saveButtonState();  
    894             setButtonsOff();  
    895             capt1.setEnabled(true);     
    896             capt1.setText(stopButton); 
    897             moreInfoB.setEnabled(false);   
    898             aboutB.setEnabled(false);  
    899         } else { 
    900             lines.removeAllElements();   
    901             capture.stop(); 
    902             totalBytesWritten1 = totalBytesWritten; // !!!!!! 
    903                 duration1 = totalBytesWritten / (double) (format.getSampleRate() * format.getSampleSizeInBits()/ 8); 
    904                 System.err.println("duration1:" + duration1); 
    905                 samplingGraph.stop(); 
    906             restoreButtonState();  
    907             play1.setEnabled(true); 
    908             capt1.setText(recordButton); 
    909             moreInfoB.setEnabled(true);   
    910             aboutB.setEnabled(true);  
    911             capt2.setEnabled(true); 
    912         } 
    913       }  
    914       else if (obj.equals(capt2)) { 
    915           if (capt2.getText().startsWith(recordButton)) { 
    916               file = null; 
    917               wavFile = wavFile2;  
    918               System.err.println("=== Record2 ==="); // !!!!!! 
    919               capture.start(uploadWavFile2);  
    920               fileName = promptID2; 
    921               samplingGraph.start(); 
    922               saveButtonState();  
    923               setButtonsOff();  
    924               capt2.setEnabled(true);     
    925               capt2.setText(stopButton); 
    926               moreInfoB.setEnabled(false); 
    927               aboutB.setEnabled(false);  
    928           } else { 
    929               lines.removeAllElements();   
    930               capture.stop(); 
    931               totalBytesWritten2 = totalBytesWritten; // !!!!!! 
    932               duration2 = totalBytesWritten / (double) (format.getSampleRate() * format.getSampleSizeInBits()/ 8); 
    933               System.err.println("duration2:" + duration2); 
    934               samplingGraph.stop(); 
    935               restoreButtonState();  
    936               play2.setEnabled(true); 
    937               capt2.setText(recordButton); 
    938               moreInfoB.setEnabled(true); 
    939               aboutB.setEnabled(true);  
    940               capt3.setEnabled(true); 
    941           } 
    942         }     
    943       else if (obj.equals(capt3)) { 
    944           if (capt3.getText().startsWith(recordButton)) { 
    945               file = null; 
    946               wavFile = wavFile3;  
    947               System.err.println("=== Record3 ==="); // !!!!!! 
    948               capture.start(uploadWavFile3);    
    949               fileName = promptID3; 
    950               samplingGraph.start(); 
    951               saveButtonState();  
    952               setButtonsOff();  
    953               capt3.setEnabled(true);     
    954               capt3.setText(stopButton); 
    955               moreInfoB.setEnabled(false); 
    956               aboutB.setEnabled(false);  
    957           } else { 
    958               lines.removeAllElements();   
    959               capture.stop(); 
    960               totalBytesWritten3 = totalBytesWritten; // !!!!!! 
    961               duration3 = totalBytesWritten / (double) (format.getSampleRate() * format.getSampleSizeInBits()/ 8); 
    962               System.err.println("duration3:" + duration3); 
    963               samplingGraph.stop(); 
    964               restoreButtonState();  
    965               play3.setEnabled(true); 
    966               capt3.setText(recordButton); 
    967               moreInfoB.setEnabled(true); 
    968               aboutB.setEnabled(true);  
    969               capt4.setEnabled(true); 
    970           } 
    971         }  
    972       else if (obj.equals(capt4)) { 
    973           if (capt4.getText().startsWith(recordButton)) { 
    974               file = null; 
    975               wavFile = wavFile4;      
    976               System.err.println("=== Record4 ==="); // !!!!!! 
    977               capture.start(uploadWavFile4);  
    978               fileName = promptID4; 
    979               samplingGraph.start(); 
    980               saveButtonState();  
    981               setButtonsOff();  
    982               capt4.setEnabled(true);     
    983               capt4.setText(stopButton); 
    984               moreInfoB.setEnabled(false);   
    985               aboutB.setEnabled(false);                
    986           } else { 
    987               lines.removeAllElements();   
    988               capture.stop(); 
    989               totalBytesWritten4 = totalBytesWritten; // !!!!!! 
    990               duration4 = totalBytesWritten / (double) (format.getSampleRate() * format.getSampleSizeInBits()/ 8); 
    991               samplingGraph.stop(); 
    992                   System.err.println("duration4:" + duration4); 
    993               restoreButtonState();  
    994               play4.setEnabled(true); 
    995               capt4.setText(recordButton); 
    996               moreInfoB.setEnabled(true); 
    997               aboutB.setEnabled(true);  
    998               capt5.setEnabled(true); 
    999           } 
    1000         }  
    1001       else if (obj.equals(capt5)) { 
    1002           if (capt5.getText().startsWith(recordButton)) { 
    1003               file = null; 
    1004               wavFile = wavFile5;     
    1005               System.err.println("=== Record5 ==="); // !!!!!! 
    1006               capture.start(uploadWavFile5);  
    1007               fileName = promptID5; 
    1008               samplingGraph.start(); 
    1009               saveButtonState();  
    1010               setButtonsOff();  
    1011               capt5.setEnabled(true);     
    1012               capt5.setText(stopButton); 
    1013               moreInfoB.setEnabled(false); 
    1014               aboutB.setEnabled(false);  
    1015           } else { 
    1016               lines.removeAllElements();   
    1017               capture.stop(); 
    1018               totalBytesWritten5 = totalBytesWritten; // !!!!!! 
    1019               duration5 = totalBytesWritten / (double) (format.getSampleRate() * format.getSampleSizeInBits()/ 8); 
    1020                   System.err.println("duration5:" + duration5); 
    1021               samplingGraph.stop(); 
    1022               restoreButtonState();  
    1023               play5.setEnabled(true); 
    1024               capt5.setText(recordButton); 
    1025               moreInfoB.setEnabled(true); 
    1026               aboutB.setEnabled(true);  
    1027               capt6.setEnabled(true); 
    1028           } 
    1029         }     
    1030       else if (obj.equals(capt6)) { 
    1031           if (capt6.getText().startsWith(recordButton)) { 
    1032               file = null; 
    1033               wavFile = wavFile6;   
    1034               System.err.println("=== Record6 ===");// !!!!!! 
    1035               capture.start(uploadWavFile6);   
    1036               fileName = promptID6; 
    1037               samplingGraph.start(); 
    1038               saveButtonState();  
    1039               setButtonsOff();  
    1040               capt6.setEnabled(true);     
    1041               capt6.setText(stopButton); 
    1042               moreInfoB.setEnabled(false);   
    1043               aboutB.setEnabled(false);  
    1044           } else { 
    1045               lines.removeAllElements();   
    1046               capture.stop(); 
    1047               totalBytesWritten6 = totalBytesWritten; // !!!!!!        
    1048               duration6 = totalBytesWritten / (double) (format.getSampleRate() * format.getSampleSizeInBits()/ 8); 
    1049               System.err.println("duration6:" + duration6); 
    1050               samplingGraph.stop(); 
    1051               restoreButtonState();  
    1052               play6.setEnabled(true); 
    1053               capt6.setText(recordButton); 
    1054               moreInfoB.setEnabled(true); 
    1055               aboutB.setEnabled(true);  
    1056               capt7.setEnabled(true); 
    1057           } 
    1058         }  
    1059         else if (obj.equals(capt7)) { 
    1060             if (capt7.getText().startsWith(recordButton)) { 
    1061                 file = null; 
    1062                 wavFile = wavFile7;      
    1063                 System.err.println("=== Record7 ===");// !!!!!! 
    1064                 capture.start(uploadWavFile7);   
    1065                 fileName = promptID7; 
    1066                 samplingGraph.start(); 
    1067                 saveButtonState();  
    1068                 setButtonsOff();  
    1069                 capt7.setEnabled(true);     
    1070                 capt7.setText(stopButton); 
    1071                 moreInfoB.setEnabled(false);   
    1072                 aboutB.setEnabled(false);   
    1073             } else { 
    1074                 lines.removeAllElements();   
    1075                 capture.stop(); 
    1076                 totalBytesWritten7 = totalBytesWritten; // !!!!!! 
    1077                 duration7 = totalBytesWritten / (double) (format.getSampleRate() * format.getSampleSizeInBits()/ 8); 
    1078                 System.err.println("duration7:" + duration7); 
    1079                 samplingGraph.stop(); 
    1080                 restoreButtonState();  
    1081                 play7.setEnabled(true); 
    1082                 capt7.setText(recordButton); 
    1083                 moreInfoB.setEnabled(true); 
    1084                 aboutB.setEnabled(true);  
    1085                 capt8.setEnabled(true); 
    1086             } 
    1087           }     
    1088         else if (obj.equals(capt8)) { 
    1089             if (capt8.getText().startsWith(recordButton)) { 
    1090                 file = null; 
    1091                 wavFile = wavFile8;   
    1092                 System.err.println("=== Record8 ===");// !!!!!! 
    1093                 capture.start(uploadWavFile8);    
    1094                 fileName = promptID8; 
    1095                 samplingGraph.start(); 
    1096                 saveButtonState();  
    1097                 setButtonsOff();  
    1098                 capt8.setEnabled(true);     
    1099                 capt8.setText(stopButton); 
    1100                 moreInfoB.setEnabled(false);   
    1101                 aboutB.setEnabled(false);  
    1102             } else { 
    1103                 lines.removeAllElements();   
    1104                 capture.stop(); 
    1105                 totalBytesWritten8 = totalBytesWritten; // !!!!!! 
    1106                 duration8 = totalBytesWritten / (double) (format.getSampleRate() * format.getSampleSizeInBits()/ 8); 
    1107                 System.err.println("duration8:" + duration8); 
    1108                 samplingGraph.stop(); 
    1109                 restoreButtonState();  
    1110                 play8.setEnabled(true); 
    1111                 capt8.setText(recordButton); 
    1112                 moreInfoB.setEnabled(true); 
    1113                 aboutB.setEnabled(true);  
    1114                 capt9.setEnabled(true); 
    1115             } 
    1116           }  
    1117         else if (obj.equals(capt9)) { 
    1118             if (capt9.getText().startsWith(recordButton)) { 
    1119                 file = null; 
    1120                 wavFile = wavFile9;    
    1121                 System.err.println("=== Record9 ===");// !!!!!! 
    1122                 capture.start(uploadWavFile9);   
    1123                 fileName = promptID9; 
    1124                 samplingGraph.start(); 
    1125                 saveButtonState();  
    1126                 setButtonsOff();  
    1127                 capt9.setEnabled(true);     
    1128                 capt9.setText(stopButton); 
    1129                 moreInfoB.setEnabled(false);  
    1130                 aboutB.setEnabled(false);  
    1131             } else { 
    1132                 lines.removeAllElements();   
    1133                 capture.stop(); 
    1134                 totalBytesWritten9 = totalBytesWritten; // !!!!!! 
    1135                 duration9 = totalBytesWritten / (double) (format.getSampleRate() * format.getSampleSizeInBits()/ 8); 
    1136                 System.err.println("duration9:" + duration9); 
    1137                 samplingGraph.stop(); 
    1138                 restoreButtonState();  
    1139                 play9.setEnabled(true); 
    1140                 capt9.setText(recordButton); 
    1141                 moreInfoB.setEnabled(true);   
    1142                 aboutB.setEnabled(true);  
    1143                 capt10.setEnabled(true); 
    1144             } 
    1145           }  
    1146         else if (obj.equals(capt10)) { 
    1147             if (capt10.getText().startsWith(recordButton)) { 
    1148                 file = null; 
    1149                 wavFile = wavFile10;     
    1150                 System.err.println("=== Record10 ===");// !!!!!! 
    1151                 capture.start(uploadWavFile10);  
    1152                 fileName = promptID10; 
    1153                 samplingGraph.start(); 
    1154                 saveButtonState();  
    1155                 setButtonsOff();  
    1156                 capt10.setEnabled(true);     
    1157                 capt10.setText(stopButton); 
    1158                 moreInfoB.setEnabled(false);   
    1159                 aboutB.setEnabled(false);  
    1160             } else { 
    1161                 lines.removeAllElements();   
    1162                 capture.stop(); 
    1163                 totalBytesWritten10 = totalBytesWritten; // !!!!!! 
    1164                 duration10 = totalBytesWritten / (double) (format.getSampleRate() * format.getSampleSizeInBits()/ 8); 
    1165                 System.err.println("duration10:" + duration10); 
    1166                 samplingGraph.stop(); 
    1167                 restoreButtonState();  
    1168                 play10.setEnabled(true); 
    1169                 capt10.setText(recordButton); 
    1170                 moreInfoB.setEnabled(true);   
    1171                 aboutB.setEnabled(true);  
    1172                 uploadB.setEnabled(true); 
    1173             } 
    1174           }   
    1175           !!!!!! */ 
     592 
    1176593//          ################### Upload #######################################                
    1177   //      else if (obj.equals(uploadB)) { 
    1178                 //!!!!!! 
    1179594            if (obj.equals(uploadB)) {  
    1180595                for (int i = 0; i < numberofPrompts; i++) { 
     
    1182597                    captA[i].setEnabled(false); 
    1183598                } 
    1184                 /* 
    1185                play1.setEnabled(false); 
    1186                capt1.setEnabled(false); 
    1187                play2.setEnabled(false); 
    1188                capt2.setEnabled(false); 
    1189                play3.setEnabled(false); 
    1190                capt3.setEnabled(false); 
    1191                play4.setEnabled(false); 
    1192                capt4.setEnabled(false);     
    1193                play5.setEnabled(false); 
    1194                capt5.setEnabled(false);         
    1195                play6.setEnabled(false); 
    1196                capt6.setEnabled(false); 
    1197                play7.setEnabled(false); 
    1198                capt7.setEnabled(false); 
    1199                play8.setEnabled(false); 
    1200                capt8.setEnabled(false); 
    1201                play9.setEnabled(false); 
    1202                capt9.setEnabled(false);     
    1203                play10.setEnabled(false); 
    1204                capt10.setEnabled(false);    
    1205              !!!!!! */ 
    1206599               uploadB.setEnabled(false);                
    1207600                try { 
     
    1364757                thread = null; 
    1365758                samplingGraph.stop(); 
    1366                 // !!!!!! 
    1367759                for (int i = 0; i < numberofPrompts; i++) { 
    1368760                        if (playA[i].getText().startsWith(stopButton)) { //play button gets set to "Stop" after play is pressed 
     
    1370762                        } 
    1371763                } 
    1372                 /* 
    1373               if (play1.getText().startsWith(stopButton)) { //play button gets set to "Stop" after play is pressed 
    1374                   capt1.setEnabled(true);  
    1375               } else if (play2.getText().startsWith(stopButton)) { //play button gets set to "Stop" after play is pressed 
    1376                   capt2.setEnabled(true);  
    1377               }else if (play3.getText().startsWith(stopButton)) { //play button gets set to "Stop" after play is pressed 
    1378                   capt3.setEnabled(true);  
    1379               }else if (play4.getText().startsWith(stopButton)) { //play button gets set to "Stop" after play is pressed 
    1380                   capt4.setEnabled(true);  
    1381               }else if (play5.getText().startsWith(stopButton)) { //play button gets set to "Stop" after play is pressed 
    1382                   capt5.setEnabled(true);  
    1383               }else if (play6.getText().startsWith(stopButton)) { //play button gets set to "Stop" after play is pressed 
    1384                   capt6.setEnabled(true);  
    1385               }else if (play7.getText().startsWith(stopButton)) { //play button gets set to "Stop" after play is pressed 
    1386                   capt7.setEnabled(true);  
    1387               }else if (play8.getText().startsWith(stopButton)) { //play button gets set to "Stop" after play is pressed 
    1388                   capt8.setEnabled(true);  
    1389               }else if (play9.getText().startsWith(stopButton)) { //play button gets set to "Stop" after play is pressed 
    1390                   capt9.setEnabled(true);  
    1391               }else if (play10.getText().startsWith(stopButton)) { //play button gets set to "Stop" after play is pressed 
    1392                   capt10.setEnabled(true);  
    1393               } 
    1394               !!!!!!! */ 
    1395               // !!!!!! 
    1396764              for (int i = 0; i < numberofPrompts; i++) { 
    1397765                  playA[i].setText(playButton); 
    1398766              } 
    1399               /* 
    1400               play1.setText(playButton); 
    1401               play2.setText(playButton); 
    1402               play3.setText(playButton); 
    1403               play4.setText(playButton); 
    1404               play5.setText(playButton);      
    1405               play6.setText(playButton); 
    1406               play7.setText(playButton); 
    1407               play8.setText(playButton); 
    1408               play9.setText(playButton); 
    1409               play10.setText(playButton); 
    1410               !!!!!! */  
    1411767            }  
    1412768        } 
     
    17281084                        System.err.println("Destination URL is " + destinationURL); 
    17291085                         
    1730                         File[] files = new File[15]; 
     1086 
    17311087                        //############ audio files #########################