Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JDK 17 java.desktop.jmod - Desktop Module
JDK 17 java.desktop.jmod is the JMOD file for JDK 17 Desktop module.
JDK 17 Desktop module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\java.desktop.jmod.
JDK 17 Desktop module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 Desktop module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\java.desktop.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ com/sun/media/sound/AudioFileSoundbankReader.java
/* * Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package com.sun.media.sound; import java.io.ByteArrayOutputStream; import java.io.DataInputStream; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URL; import javax.sound.midi.InvalidMidiDataException; import javax.sound.midi.Soundbank; import javax.sound.midi.spi.SoundbankReader; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.UnsupportedAudioFileException; /** * Soundbank reader that uses audio files as soundbanks. * * @author Karl Helgason */ public final class AudioFileSoundbankReader extends SoundbankReader { @Override public Soundbank getSoundbank(URL url) throws InvalidMidiDataException, IOException { try { AudioInputStream ais = AudioSystem.getAudioInputStream(url); Soundbank sbk = getSoundbank(ais); ais.close(); return sbk; } catch (UnsupportedAudioFileException e) { return null; } catch (IOException e) { return null; } } @Override public Soundbank getSoundbank(InputStream stream) throws InvalidMidiDataException, IOException { stream.mark(512); try { AudioInputStream ais = AudioSystem.getAudioInputStream(stream); Soundbank sbk = getSoundbank(ais); if (sbk != null) return sbk; } catch (UnsupportedAudioFileException e) { } catch (IOException e) { } stream.reset(); return null; } public Soundbank getSoundbank(AudioInputStream ais) throws InvalidMidiDataException, IOException { int MEGABYTE = 1048576; int DEFAULT_BUFFER_SIZE = 65536; int MAX_FRAME_SIZE = 1024; try { byte[] buffer; int frameSize = ais.getFormat().getFrameSize(); if (frameSize <= 0 || frameSize > MAX_FRAME_SIZE) { throw new InvalidMidiDataException("Formats with frame size " + frameSize + " are not supported"); } long totalSize = ais.getFrameLength() * frameSize; if (totalSize >= Integer.MAX_VALUE - 2) { throw new InvalidMidiDataException( "Can not allocate enough memory to read audio data."); } if (ais.getFrameLength() == -1 || totalSize > MEGABYTE) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buff = new byte[DEFAULT_BUFFER_SIZE - (DEFAULT_BUFFER_SIZE % frameSize)]; int ret; while ((ret = ais.read(buff)) != -1) { baos.write(buff, 0, ret); } ais.close(); buffer = baos.toByteArray(); } else { buffer = new byte[(int) totalSize]; new DataInputStream(ais).readFully(buffer); } ModelByteBufferWavetable osc = new ModelByteBufferWavetable( new ModelByteBuffer(buffer), ais.getFormat(), -4800); ModelPerformer performer = new ModelPerformer(); performer.getOscillators().add(osc); SimpleSoundbank sbk = new SimpleSoundbank(); SimpleInstrument ins = new SimpleInstrument(); ins.add(performer); sbk.addInstrument(ins); return sbk; } catch (Exception e) { return null; } } @Override public Soundbank getSoundbank(File file) throws InvalidMidiDataException, IOException { try { AudioInputStream ais = AudioSystem.getAudioInputStream(file); ais.close(); ModelByteBufferWavetable osc = new ModelByteBufferWavetable( new ModelByteBuffer(file, 0, file.length()), -4800); ModelPerformer performer = new ModelPerformer(); performer.getOscillators().add(osc); SimpleSoundbank sbk = new SimpleSoundbank(); SimpleInstrument ins = new SimpleInstrument(); ins.add(performer); sbk.addInstrument(ins); return sbk; } catch (UnsupportedAudioFileException e1) { return null; } catch (IOException e) { return null; } } }
⏎ com/sun/media/sound/AudioFileSoundbankReader.java
Or download all of them as a single archive file:
File name: java.desktop-17.0.5-src.zip File size: 9152233 bytes Release date: 2022-09-13 Download
⇒ JDK 17 java.instrument.jmod - Instrument Module
2023-09-16, 33408👍, 0💬
Popular Posts:
Apache Ant Source Code Files are inside the Apache Ant source package file like apache-ant-1.10.10-s...
JDK 1.1 source code directory contains Java source code for JDK 1.1 core classes: "C:\fyicenter\jdk-...
Commons VFS provides a single API for accessing various different file systems. It presents a unifor...
How to run "javac" command from JDK tools.jar file? "javac" is the Java compiler command that allows...
What Is poi-3.5.jar - Part 2? poi-3.5.jar is one of the JAR files for Apache POI 3.5, which provides...