Ejemplo n.º 1
0
 private void decodeFrame() {
   if (!mp4.hasMoreFrames()) {
     buffer.close();
     return;
   }
   try {
     final AudioFrame frame = mp4.readNextFrame();
     if (frame == null) {
       buffer.close();
       return;
     }
     decoder.decodeFrame(frame.getData(), sampleBuffer);
   } catch (IOException e) {
     buffer.close();
     return;
   }
 }
Ejemplo n.º 2
0
 MP4AudioInputStream(InputStream in, AudioFormat format, long length) throws IOException {
   super(in, format, length);
   mp4 = new MP4Reader(in);
   final DecoderConfig conf =
       DecoderConfig.parseMP4DecoderSpecificInfo(mp4.getDecoderSpecificInfo());
   decoder = new Decoder(conf);
   sampleBuffer = new SampleBuffer();
 }