Changeset 2375
- Timestamp:
- 12/28/07 15:47:02 (9 months ago)
- Files:
-
- Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/CapturePlayback.java (modified) (41 diffs)
- Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/LICENSE (modified) (1 diff)
- Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/License.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/CapturePlayback.java
r2374 r2375 785 785 wavFile = wavFile1; 786 786 duration = duration1; 787 // !!!!!!788 System.err.println("play1 totalBytesWritten1:" + totalBytesWritten1);789 // !!!!!!790 787 totalBytesWritten = totalBytesWritten1; 788 System.err.println("=== Play1 ===");// !!!!!! 791 789 playback.start(); 790 System.err.println("duration:" + duration); 792 791 fileName = promptID1; 793 792 samplingGraph.start(); … … 805 804 wavFile = wavFile2; 806 805 duration = duration2; 807 // !!!!!!808 System.err.println("play2 totalBytesWritten2:" + totalBytesWritten2);809 // !!!!!!810 806 totalBytesWritten = totalBytesWritten2; 807 System.err.println("=== Play2 ===");// !!!!!! 811 808 playback.start(); 809 System.err.println("duration:" + duration); // !!!!!! 812 810 fileName = promptID2; 813 811 samplingGraph.start(); … … 825 823 wavFile = wavFile3; 826 824 duration = duration3; 827 // !!!!!!828 System.err.println("play3 totalBytesWritten3:" + totalBytesWritten3);829 // !!!!!!830 825 totalBytesWritten = totalBytesWritten3; 826 System.err.println("=== Play3 ===");// !!!!!! 831 827 playback.start(); 828 System.err.println("duration:" + duration); // !!!!!! 832 829 fileName = promptID3; 833 830 samplingGraph.start(); … … 845 842 wavFile = wavFile4; 846 843 duration = duration4; 847 // !!!!!!848 System.err.println("play4 totalBytesWritten4:" + totalBytesWritten4);849 // !!!!!!850 844 totalBytesWritten = totalBytesWritten4; 845 System.err.println("=== Play4 ===");// !!!!!! 851 846 playback.start(); 847 System.err.println("duration:" + duration); // !!!!!! 852 848 fileName = promptID4; 853 849 samplingGraph.start(); … … 865 861 wavFile = wavFile5; 866 862 duration = duration5; 867 // !!!!!!868 System.err.println("play5 totalBytesWritten5:" + totalBytesWritten5);869 // !!!!!!870 863 totalBytesWritten = totalBytesWritten5; 864 System.err.println("=== Play5 ===");// !!!!!! 871 865 playback.start(); 866 System.err.println("duration:" + duration); // !!!!!! 872 867 fileName = promptID5; 873 868 samplingGraph.start(); … … 886 881 duration = duration6; 887 882 totalBytesWritten = totalBytesWritten6; 883 System.err.println("=== Play6 ===");// !!!!!! 888 884 playback.start(); 885 System.err.println("duration:" + duration); // !!!!!! 889 886 fileName = promptID6; 890 887 samplingGraph.start(); … … 903 900 duration = duration7; 904 901 totalBytesWritten = totalBytesWritten7; 902 System.err.println("=== Play7 ===");// !!!!!! 905 903 playback.start(); 904 System.err.println("duration:" + duration); // !!!!!! 906 905 fileName = promptID7; 907 906 samplingGraph.start(); … … 920 919 duration = duration8; 921 920 totalBytesWritten = totalBytesWritten8; 921 System.err.println("=== Play8 ===");// !!!!!! 922 922 playback.start(); 923 System.err.println("duration:" + duration); // !!!!!! 923 924 fileName = promptID8; 924 925 samplingGraph.start(); … … 937 938 duration = duration9; 938 939 totalBytesWritten = totalBytesWritten9; 940 System.err.println("=== Play9 ===");// !!!!!! 939 941 playback.start(); 942 System.err.println("duration:" + duration); // !!!!!! 940 943 fileName = promptID9; 941 944 samplingGraph.start(); … … 954 957 duration = duration10; 955 958 totalBytesWritten = totalBytesWritten10; 959 System.err.println("=== Play10 ===");// !!!!!! 956 960 playback.start(); 961 System.err.println("duration:" + duration); // !!!!!! 957 962 fileName = promptID10; 958 963 samplingGraph.start(); … … 971 976 file = null; 972 977 wavFile = wavFile1; 973 // duration1 = 0; 978 System.err.println("=== Record1 ==="); // !!!!!! 974 979 capture.start(uploadWavFile1); 975 duration1 = duration;976 980 fileName = promptID1; 977 981 samplingGraph.start(); … … 985 989 lines.removeAllElements(); 986 990 capture.stop(); 987 totalBytesWritten1 = totalBytesWritten;988 991 // !!!!!! 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); 990 996 // !!!!!! 991 samplingGraph.stop();997 samplingGraph.stop(); 992 998 restoreButtonState(); 993 999 play1.setEnabled(true); … … 1002 1008 file = null; 1003 1009 wavFile = wavFile2; 1004 // duration2 = 0;1010 System.err.println("=== Record2 ==="); // !!!!!! 1005 1011 capture.start(uploadWavFile2); 1006 duration2 = duration;1007 1012 fileName = promptID2; 1008 1013 samplingGraph.start(); … … 1016 1021 lines.removeAllElements(); 1017 1022 capture.stop(); 1018 totalBytesWritten2 = totalBytesWritten;1019 1023 // !!!!!! 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); 1021 1028 // !!!!!! 1022 1029 samplingGraph.stop(); … … 1033 1040 file = null; 1034 1041 wavFile = wavFile3; 1035 // duration3 = 0;1042 System.err.println("=== Record3 ==="); // !!!!!! 1036 1043 capture.start(uploadWavFile3); 1037 duration3 = duration;1038 1044 fileName = promptID3; 1039 1045 samplingGraph.start(); … … 1047 1053 lines.removeAllElements(); 1048 1054 capture.stop(); 1049 totalBytesWritten3 = totalBytesWritten;1050 1055 // !!!!!! 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); 1052 1060 // !!!!!! 1053 1061 samplingGraph.stop(); … … 1064 1072 file = null; 1065 1073 wavFile = wavFile4; 1066 // duration4 = 0;1074 System.err.println("=== Record4 ==="); // !!!!!! 1067 1075 capture.start(uploadWavFile4); 1068 duration4 = duration;1069 1076 fileName = promptID4; 1070 1077 samplingGraph.start(); … … 1078 1085 lines.removeAllElements(); 1079 1086 capture.stop(); 1080 totalBytesWritten4 = totalBytesWritten;1081 1087 // !!!!!! 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); 1083 1093 // !!!!!! 1084 samplingGraph.stop();1085 1094 restoreButtonState(); 1086 1095 play4.setEnabled(true); … … 1095 1104 file = null; 1096 1105 wavFile = wavFile5; 1097 // duration5 = 0; 1098 capture.start(uploadWavFile5); 1099 duration5 = duration; 1106 System.err.println("=== Record5 ==="); // !!!!!! 1107 capture.start(uploadWavFile5); 1100 1108 fileName = promptID5; 1101 1109 samplingGraph.start(); … … 1109 1117 lines.removeAllElements(); 1110 1118 capture.stop(); 1111 totalBytesWritten5 = totalBytesWritten;1112 1119 // !!!!!! 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); 1114 1124 // !!!!!! 1115 1125 samplingGraph.stop(); … … 1126 1136 file = null; 1127 1137 wavFile = wavFile6; 1128 // duration6 = 0;1138 System.err.println("=== Record6 ===");// !!!!!! 1129 1139 capture.start(uploadWavFile6); 1130 totalBytesWritten6 = totalBytesWritten;1131 duration6 = duration;1132 1140 fileName = promptID6; 1133 1141 samplingGraph.start(); … … 1141 1149 lines.removeAllElements(); 1142 1150 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 // !!!!!! 1143 1157 samplingGraph.stop(); 1144 1158 restoreButtonState(); … … 1154 1168 file = null; 1155 1169 wavFile = wavFile7; 1156 // duration7 = 0;1170 System.err.println("=== Record7 ===");// !!!!!! 1157 1171 capture.start(uploadWavFile7); 1158 totalBytesWritten7 = totalBytesWritten;1159 duration7 = duration;1160 1172 fileName = promptID7; 1161 1173 samplingGraph.start(); … … 1169 1181 lines.removeAllElements(); 1170 1182 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 // !!!!!! 1171 1189 samplingGraph.stop(); 1172 1190 restoreButtonState(); … … 1182 1200 file = null; 1183 1201 wavFile = wavFile8; 1184 // duration8 = 0;1202 System.err.println("=== Record8 ===");// !!!!!! 1185 1203 capture.start(uploadWavFile8); 1186 totalBytesWritten8 = totalBytesWritten;1187 duration8 = duration;1188 1204 fileName = promptID8; 1189 1205 samplingGraph.start(); … … 1197 1213 lines.removeAllElements(); 1198 1214 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 // !!!!!! 1199 1221 samplingGraph.stop(); 1200 1222 restoreButtonState(); … … 1210 1232 file = null; 1211 1233 wavFile = wavFile9; 1212 // duration9 = 0;1234 System.err.println("=== Record9 ===");// !!!!!! 1213 1235 capture.start(uploadWavFile9); 1214 totalBytesWritten9 = totalBytesWritten;1215 duration9 = duration;1216 1236 fileName = promptID9; 1217 1237 samplingGraph.start(); … … 1225 1245 lines.removeAllElements(); 1226 1246 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 // !!!!!! 1227 1253 samplingGraph.stop(); 1228 1254 restoreButtonState(); … … 1238 1264 file = null; 1239 1265 wavFile = wavFile10; 1240 // duration10 = 0;1266 System.err.println("=== Record10 ===");// !!!!!! 1241 1267 capture.start(uploadWavFile10); 1242 totalBytesWritten10 = totalBytesWritten;1243 duration10 = duration;1244 1268 fileName = promptID10; 1245 1269 samplingGraph.start(); … … 1253 1277 lines.removeAllElements(); 1254 1278 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 // !!!!!! 1255 1285 samplingGraph.stop(); 1256 1286 restoreButtonState(); … … 1344 1374 long milliseconds = (long)((audioInputStream.getFrameLength() * 1000) / audioInputStream.getFormat().getFrameRate()); 1345 1375 duration = milliseconds / 1000.0; 1376 // !!!!!! 1377 System.err.println("createAudioInputStream duration:" + duration); 1378 // !!!!!! 1346 1379 if (updateComponents) { 1347 1380 //DEL formatControls.setFormat(audioInputStream.getFormat()); … … 1426 1459 1427 1460 public void start() { 1428 // !!!!!!1429 System.err.println("=== Play =========================================================");1430 // !!!!!!1431 1432 1461 errStr = null; 1433 1462 thread = new Thread(this); … … 1484 1513 public void run() { 1485 1514 // reload the file if loaded by file 1486 if (file != null) {1515 /* !!!!!! if (file != null) { 1487 1516 createAudioInputStream(file, false); 1517 // !!!!!! 1518 System.err.println("playback ...createAudioInputStream file:" + file); 1519 // !!!!!! 1488 1520 } 1489 1521 … … 1493 1525 return; 1494 1526 } 1527 !!!!!! */ 1495 1528 // reset to the beginning of the stream 1496 1529 … … 1558 1591 byte audioBytes[] = outbaos.toByteArray(); 1559 1592 // !!!!!! 1560 System.err.println("outbaos size:" + outbaos.size());1593 // debug System.err.println("outbaos size:" + outbaos.size()); 1561 1594 outbaos.reset(); 1562 1595 outbaos = null; … … 1622 1655 public void start(File uploadWavFile) { 1623 1656 this.uploadWavFile = uploadWavFile; 1624 // !!!!!!1625 System.err.println("== Capture =========================================================");1626 // !!!!!!1627 1657 System.err.println("Capture uploadWavFile is:" + uploadWavFile); 1628 1658 … … 1736 1766 // load bytes into the audio input stream for playback 1737 1767 getAudioInputStream(); 1738 1739 System.err.println("Capture.run uploadWavFile is:" + uploadWavFile); 1740 1768 1741 1769 // saveToFile(this.uploadWavFile, AudioFileFormat.Type.WAVE); 1742 1770 try { … … 1749 1777 1750 1778 duration = totalBytesWritten / (double) (format.getSampleRate() * format.getSampleSizeInBits()/ 8); 1779 // !!!!!! 1780 System.err.println("capture duration:" + duration); 1781 // !!!!!! 1751 1782 // debug System.err.println("Calculated duration"); 1752 1783 samplingGraph.createWaveForm(audioBytes); … … 1772 1803 } 1773 1804 } 1774 // !!!!!! 1775 System.err.println("getAudioInputStream - totalBytesWritten:" + totalBytesWritten); 1776 // !!!!!! 1805 // debug System.err.println("getAudioInputStream - totalBytesWritten:" + totalBytesWritten); 1777 1806 try { 1778 1807 // audioInputStream = AudioSystem.getAudioInputStream(wavFile); … … 1802 1831 thread = new Thread(this); 1803 1832 thread.setName("ConvertAndUpload"); 1833 // !!!!!! 1834 System.err.println("=== Upload ==="); 1835 // !!!!!! 1804 1836 thread.start(); 1805 1837 } … … 1940 1972 1941 1973 if (userName != null){ 1942 archiveFile = new File(tempdir + userName + "-" + date + "-" + randomID + ".zip");1974 archiveFile = new File(tempdir + language + "-" + userName + "-" + date + "-" + randomID + ".zip"); 1943 1975 } else { 1944 archiveFile = new File(tempdir + "Anonymous-" + date + "-" + randomID + ".zip");1976 archiveFile = new File(tempdir + language + "-" + "Anonymous-" + date + "-" + randomID + ".zip"); 1945 1977 } 1946 1978 Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/LICENSE
r2320 r2375 15 15 Java code from other projects: 16 16 - MoodleSpeex, (c) Dan Stowell 2006. 17 - JSpeex player/recorder, (c) Wimba S.A.18 17 - Postlet HTTP uploader, (c) Simon Rycroft 19 18 - JavaSoundDemo, (c) Sun Microsystems Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/License.java
r2366 r2375 48 48 49 49 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") 51 51 + "============================" + System.getProperty("line.separator") 52 52 + "Allows a user to record their speech and upload it to the VoxForge server" + System.getProperty("line.separator") … … 76 76 + "from other projects:"+ System.getProperty("line.separator") 77 77 + " - MoodleSpeex, (c) Dan Stowell 2006."+ System.getProperty("line.separator") 78 + " - JSpeex player/recorder, (c) Wimba S.A."+ System.getProperty("line.separator")79 78 + " - Postlet HTTP uploader, (c) Simon Rycroft"+ System.getProperty("line.separator") 80 79 + " - JavaSoundDemo, (c) Sun Microsystems"+ System.getProperty("line.separator")