예제 #1
0
 @Override
 public AudioFormat getFormat() {
   if (audioFormat == null) {
     // read first frame
     decodeFrame();
     audioFormat =
         new AudioFormat(
             sampleBuffer.getSampleRate(),
             sampleBuffer.getBitsPerSample(),
             sampleBuffer.getChannels(),
             true,
             true);
     saved = sampleBuffer.getData();
   }
   return audioFormat;
 }
예제 #2
0
 public void execute() {
   if (saved == null) {
     decodeFrame();
     if (buffer.isOpen()) buffer.write(sampleBuffer.getData());
   } else {
     buffer.write(saved);
     saved = null;
   }
 }