Package javax.sound.sampled

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


        assertEquals(8, ais.read(new byte[10]));
        assertEquals(985, ais.available());
        assertEquals(0, ais.skip(2));
        assertEquals(8, ais.skip(10));
        ais.reset();
        assertEquals(993, ais.available());
        assertEquals(0, ais.read(new byte[10], -1, 2));
        assertEquals(8, ais.read(new byte[10], 0, 11));
        try {
            ais.read();
            fail("No expected IOException");
View Full Code Here


      File file = new File(baseName);
      InputStream is = new SequenceInputStream(outputList.elements());
      AudioInputStream ais = new AudioInputStream(is,
        currentFormat, totBytes / currentFormat.getFrameSize());
            if (false) {
                System.out.println("Avail " + ais.available());
                System.out.println("totBytes " + totBytes);
                System.out.println("FS " + currentFormat.getFrameSize());
            }
            System.out.println("Wrote synthesized speech to " + baseName);
      AudioSystem.write(ais, outputType, file);
View Full Code Here

                if (!line.isActive())
                    line.start();

                int controlbuffersize = 512;
                try {
                    controlbuffersize = ais.available();
                } catch (IOException e) {
                }

                // Tell mixer not fill read buffers fully.
                // This lowers latency, and tells DataPusher
View Full Code Here

          targetLine.flush();

          while(voiceClient.running && MekanismKeyHandler.voiceKey.getIsKeyPressed())
          {
            try {
              int availableBytes = audioInput.available();
              byte[] audioData = new byte[availableBytes > 2200 ? 2200 : availableBytes];
              int bytesRead = audioInput.read(audioData, 0, audioData.length);

              if(bytesRead > 0)
              {
View Full Code Here

                if (!line.isActive())
                    line.start();

                int controlbuffersize = 512;
                try {
                    controlbuffersize = ais.available();
                } catch (IOException e) {
                }

                // Tell mixer not fill read buffers fully.
                // This lowers latency, and tells DataPusher
View Full Code Here

        }

        public int available() throws IOException {
            AudioInputStream local_stream = stream;
            if(local_stream != null)
                return local_stream.available();
            return 0;
        }

        public int read() throws IOException {
             byte[] b = new byte[1];
View Full Code Here

                if (!line.isActive())
                    line.start();

                int controlbuffersize = 512;
                try {
                    controlbuffersize = ais.available();
                } catch (IOException e) {
                }

                // Tell mixer not fill read buffers fully.
                // This lowers latency, and tells DataPusher
View Full Code Here

        }

        public int available() throws IOException {
            AudioInputStream local_stream = stream;
            if(local_stream != null)
                return local_stream.available();
            return 0;
        }

        public int read() throws IOException {
             byte[] b = new byte[1];
View Full Code Here

                if (!line.isActive())
                    line.start();

                int controlbuffersize = 512;
                try {
                    controlbuffersize = ais.available();
                } catch (IOException e) {
                }

                // Tell mixer not fill read buffers fully.
                // This lowers latency, and tells DataPusher
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.