Changeset 32914 in osm for applications/editors/josm/plugins/wms-turbo-challenge2/src/wmsturbochallenge/EngineSound.java
- Timestamp:
- 2016-09-03T17:08:38+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/wms-turbo-challenge2/src/wmsturbochallenge/EngineSound.java
r32322 r32914 30 30 31 31 AudioFormat output_format = 32 new AudioFormat(S_RATE, 16, 1, true, true); 32 new AudioFormat(S_RATE, 16, 1, true, true); 33 33 DataLine.Info info = 34 new DataLine.Info(SourceDataLine.class, output_format); 34 new DataLine.Info(SourceDataLine.class, output_format); 35 35 36 36 /* Get the data line, open it and initialise the device */ … … 109 109 110 110 protected class audio_task extends TimerTask { 111 @Override 111 112 public void run() { 112 113 if (output == null) … … 127 128 int wavelen = (int) (S_RATE / freq); 128 129 int bufferlen = MIN_BUFFER - (MIN_BUFFER % wavelen) + 129 wavelen; 130 wavelen; 130 131 int value = (int) (0x7fff * volume); 131 132 … … 147 148 148 149 frames_written += 149 output.write(buffer, 0, bufferlen) / 2; 150 output.write(buffer, 0, bufferlen) / 2; 150 151 151 152 reschedule(frames_current); … … 158 159 * about half into the last frame). */ 159 160 long delay = (frames_written - frames - MIN_BUFFER / 2) * 160 1000 / S_RATE; 161 1000 / S_RATE; 161 162 if (delay < 0) 162 163 delay = 0;
Note:
See TracChangeset
for help on using the changeset viewer.