Changeset 2358
- Timestamp:
- 11/18/07 22:28:45 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/CapturePlayback.java
r2357 r2358 74 74 public static final int samplingRateFormat = 16; 75 75 public static final int numberChannels = 1; 76 /*this code snippet might work to query audio card for sampling rate ...77 * DataLine.Info info = new DataLine.Info(TargetDataLine.class,78 samplingRateFormat); // format is an AudioFormat object79 if (!AudioSystem.isLineSupported(info)) {80 // Handle the error.81 }82 // Obtain and open the line.83 try {84 line = (TargetDataLine) AudioSystem.getLine(info);85 line.open(format);86 } catch (LineUnavailableException ex) {87 // Handle the error.88 //...89 }90 91 */92 76 93 77 AudioFormat format = new AudioFormat(samplingRate, samplingRateFormat, numberChannels, true, false); … … 199 183 private File licenseNoticeFile; 200 184 201 //DEL JLabel progCompletion;202 185 JProgressBar progBar; 203 186 int sentBytes; … … 234 217 // ############ Localized Fields #################################### 235 218 JTextField usernameTextField; 236 LabelLocalizer labels = new LabelLocalizer("Dutch");219 LabelLocalizer labels = new LabelLocalizer("Dutch"); 237 220 // LabelLocalizer labels = new LabelLocalizer("English"); 238 221 String usernamePanelLabel = labels.usernamePanelLabel; … … 295 278 296 279 JSpeexEnc encoder; 297 298 int compressionMode = 2; // Simple compression 1 (loqual) 2 (med) 3 (hiqual) 299 280 300 281 String tempdir = getTempDir(); 301 282 public CapturePlayback(String subject, … … 359 340 this.helpPageURL = helpPageURL; 360 341 this.cookie = cookie; 361 this.compressionMode = defaultCompressionMode;362 342 363 343 capturePlayback = this; … … 1759 1739 CompressionMonitor compressionMonitor = new CompressionMonitor(); 1760 1740 1761 switch(compressionMode){1762 case 1:1763 encoder.mode = 0; // 0 = narrowband, 1 = wideband, 2 = ultrawide1764 encoder.vbr_quality = 3;1765 encoder.complexity = 6;1766 break;1767 case 2:1768 encoder.mode = 0; // 0 = narrowband, 1 = wideband, 2 = ultrawide1769 encoder.vbr_quality = 8;1770 encoder.complexity = 8;1771 break;1772 case 3:1773 encoder.mode = 1; // 0 = narrowband, 1 = wideband, 2 = ultrawide1774 encoder.vbr_quality = 9;1775 encoder.complexity = 10;1776 break;1777 }1778 1741 1779 1742 encoder.sampleRate = (int)format.getSampleRate();