git @ Cat's Eye Technologies JaC64 / b2299a7
Gracefully handle not being able to acquire an audio dataline. catseye 13 years ago
1 changed file(s) with 6 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
2222 private boolean fullSpeed = false;
2323
2424 public int available() {
25 if (dataLine == null)
26 return 0;
2527 return dataLine.available();
2628 }
2729
3032 }
3133
3234 public long getMicros() {
35 if (dataLine == null)
36 return 0;
3337 return dataLine.getMicrosecondPosition();
3438 }
3539
7579 }
7680
7781 public void write(byte[] buffer) {
82 if (dataLine == null)
83 return;
7884 int bsize = buffer.length;
7985 if (!fullSpeed) {
8086 while (dataLine.available() < bsize)