public void playSync(String filePath) { final File file = new File(filePath); try (final AudioInputStream in = getAudioInputStream(file)) { final AudioFormat outFormat = getOutFormat(in.getFormat()); final Info info = new Info(SourceDataLine.class, outFormat); try (final SourceDataLine line = (SourceDataLine) AudioSystem.getLine(info)) { if (line != null) { line.open(outFormat); line.start(); stream(getAudioInputStream(outFormat, in), line); line.drain(); line.stop(); } } } catch (Exception e) { throw new IllegalStateException(e); } }
public void play(InputStream inputStream) { stopAll(); try (final AudioInputStream in = getAudioInputStream(inputStream)) { final AudioFormat outFormat = getOutFormat(in.getFormat()); final Info info = new Info(SourceDataLine.class, outFormat); try (final SourceDataLine line = (SourceDataLine) AudioSystem.getLine(info)) { if (line != null) { lines.add(line); line.open(outFormat); line.start(); stream(getAudioInputStream(outFormat, in), line); line.drain(); line.stop(); } } } catch (UnsupportedAudioFileException | LineUnavailableException | IOException exception) { throw new IllegalStateException(exception); } }
@ObfuscatedName("w") @ObfuscatedSignature( signature = "(II)V", garbageValue = "-629465154" ) @Export("create") protected void create(int var1) throws LineUnavailableException { try { Info var2 = new Info(SourceDataLine.class, this.audioFormat, var1 << (ContextMenuRow.highMemory?2:1)); this.source = (SourceDataLine)AudioSystem.getLine(var2); this.source.open(); this.source.start(); this.size = var1; } catch (LineUnavailableException var5) { int var4 = (var1 >>> 1 & 1431655765) + (var1 & 1431655765); var4 = (var4 >>> 2 & 858993459) + (var4 & 858993459); var4 = (var4 >>> 4) + var4 & 252645135; var4 += var4 >>> 8; var4 += var4 >>> 16; int var3 = var4 & 255; if(var3 != 1) { this.create(class173.nextPowerOfTwo(var1)); } else { this.source = null; throw var5; } } }
public AudioPlayer(File audioFile, ResourceBundle messages) throws IOException { this.messages = messages; try (AudioInputStream in = AudioSystem.getAudioInputStream(audioFile.toURI().toURL())) { this.audioFile = audioFile; outFormat = getOutFormat(in.getFormat()); Info info = new Info(SourceDataLine.class, outFormat); line = (SourceDataLine) AudioSystem.getLine(info); line.open(outFormat); } catch (UnsupportedAudioFileException | LineUnavailableException e) { throw new IOException(e); } }
public void play(String filePath) { final File file = new File(filePath); try (final AudioInputStream in = getAudioInputStream(file)) { final AudioFormat outFormat = getOutFormat(in.getFormat()); final Info info = new Info(SourceDataLine.class, outFormat); try (final SourceDataLine line = (SourceDataLine) AudioSystem.getLine(info)) { if (line != null) { line.open(outFormat); line.start(); AudioInputStream inputMystream = AudioSystem.getAudioInputStream(outFormat, in); stream(inputMystream, line); line.drain(); line.stop(); } } } catch (UnsupportedAudioFileException | LineUnavailableException | IOException e) { throw new IllegalStateException(e); } }
public JavaSoundInDevice(Mixer mixer, AudioFormat af, Info info,int bufferSizeInFrames) { super(mixer, af, info,bufferSizeInFrames); framesRead = 0; doFlush = true; }
public JavaSoundOutDevice(Mixer mixer, AudioFormat af, Info info,int bufferSizeInFrames) { super(mixer, af, info, bufferSizeInFrames); }