Package javax.sound.sampled

Examples of javax.sound.sampled.AudioInputStream.skip()


                                    /* skip doesn't seem to want to skip big chunks, so
                                     * reduce it to smaller ones
                                     */
                                    // audioInputStream.skip(bytesToSkip);
                                    while (bytesToSkip > chunk) {
                                        nBytesRead = audioInputStream.skip(chunk);
                                        if (nBytesRead <= 0)
                                            throw new IOException(tr("This is after the end of the recording"));
                                        bytesToSkip -= nBytesRead;
                                    }
                                    while (bytesToSkip > 0) {
View Full Code Here


                                        if (nBytesRead <= 0)
                                            throw new IOException(tr("This is after the end of the recording"));
                                        bytesToSkip -= nBytesRead;
                                    }
                                    while (bytesToSkip > 0) {
                                        long skippedBytes = audioInputStream.skip(bytesToSkip);
                                        bytesToSkip -= skippedBytes;
                                        if (skippedBytes == 0) {
                                            // Avoid inifinite loop
                                            Main.warn("Unable to skip bytes from audio input stream");
                                            bytesToSkip = 0;
View Full Code Here

      /* Create a wave input stream from the file input stream */
      AudioInputStream waveStream = new AudioInputStream(istream,audioFormat,this.outputFile.length());

      /*Discard all the bytes until where we marked activity */
      waveStream.skip(cropLength);

      /*Write it to file in wave format*/
      AudioSystem.write(waveStream,
          AudioFileFormat.Type.WAVE,
          this.croppedWaveFile);
View Full Code Here

      /* Create a wave input stream from the file input stream */
      AudioInputStream waveStream = new AudioInputStream(istream,audioFormat,this.outputFile.length());

      /*Discard all the bytes until where we marked activity */
      waveStream.skip(cropLength);

      /*Write it to file in wave format*/
      AudioSystem.write(waveStream,
          AudioFileFormat.Type.WAVE,
          this.croppedWaveFile);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.