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/Toolkit.java
/* * Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package com.sun.media.sound; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; /** * Common conversions etc. * * @author Kara Kytle * @author Florian Bomers */ public final class Toolkit { /** * Suppresses default constructor, ensuring non-instantiability. */ private Toolkit() { } /** * Converts bytes from signed to unsigned. */ static void getUnsigned8(byte[] b, int off, int len) { for (int i = off; i < (off+len); i++) { b[i] += 128; } } /** * Swaps bytes. * @throws ArrayIndexOutOfBoundsException if len is not a multiple of 2. */ static void getByteSwapped(byte[] b, int off, int len) { byte tempByte; for (int i = off; i < (off+len); i+=2) { tempByte = b[i]; b[i] = b[i+1]; b[i+1] = tempByte; } } /** * Linear to DB scale conversion. */ static float linearToDB(float linear) { float dB = (float) (Math.log(((linear==0.0)?0.0001:linear))/Math.log(10.0) * 20.0); return dB; } /** * DB to linear scale conversion. */ static float dBToLinear(float dB) { float linear = (float) Math.pow(10.0, dB/20.0); return linear; } /* * returns bytes aligned to a multiple of blocksize * the return value will be in the range of (bytes-blocksize+1) ... bytes */ static long align(long bytes, int blockSize) { // prevent null pointers if (blockSize <= 1) { return bytes; } return bytes - (bytes % blockSize); } static int align(int bytes, int blockSize) { // prevent null pointers if (blockSize <= 1) { return bytes; } return bytes - (bytes % blockSize); } /* * gets the number of bytes needed to play the specified number of milliseconds */ static long millis2bytes(AudioFormat format, long millis) { long result = (long) (millis * format.getFrameRate() / 1000.0f * format.getFrameSize()); return align(result, format.getFrameSize()); } /* * gets the time in milliseconds for the given number of bytes */ static long bytes2millis(AudioFormat format, long bytes) { return (long) (bytes / format.getFrameRate() * 1000.0f / format.getFrameSize()); } /* * gets the number of bytes needed to play the specified number of microseconds */ static long micros2bytes(AudioFormat format, long micros) { long result = (long) (micros * format.getFrameRate() / 1000000.0f * format.getFrameSize()); return align(result, format.getFrameSize()); } /* * gets the time in microseconds for the given number of bytes */ static long bytes2micros(AudioFormat format, long bytes) { return (long) (bytes / format.getFrameRate() * 1000000.0f / format.getFrameSize()); } /* * gets the number of frames needed to play the specified number of microseconds */ static long micros2frames(AudioFormat format, long micros) { return (long) (micros * format.getFrameRate() / 1000000.0f); } /* * gets the time in microseconds for the given number of frames */ static long frames2micros(AudioFormat format, long frames) { return (long) (((double) frames) / format.getFrameRate() * 1000000.0d); } /** * Throws an exception if the buffer size does not represent an integral * number of sample frames. */ static void validateBuffer(final int frameSize, final int bufferSize) { if (bufferSize % frameSize == 0) { return; } throw new IllegalArgumentException(String.format( "Buffer size (%d) does not represent an integral number of " + "sample frames (%d)", bufferSize, frameSize)); } static void isFullySpecifiedAudioFormat(AudioFormat format) { // Our code requires a positive frame size, that's probably is not // necessary for non-linear encodings, but for now // IllegalArgumentException is better than ArithmeticException if (format.getFrameSize() <= 0) { throw new IllegalArgumentException("invalid frame size: " +((format.getFrameSize() == -1) ? "NOT_SPECIFIED":String.valueOf(format.getFrameSize()))); } if (!format.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED) && !format.getEncoding().equals(AudioFormat.Encoding.PCM_UNSIGNED) && !format.getEncoding().equals(AudioFormat.Encoding.ULAW) && !format.getEncoding().equals(AudioFormat.Encoding.ALAW)) { // we don't know how to verify possibly non-linear encodings return; } if (format.getFrameRate() <= 0) { throw new IllegalArgumentException("invalid frame rate: " +((format.getFrameRate()==-1)? "NOT_SPECIFIED":String.valueOf(format.getFrameRate()))); } if (format.getSampleRate() <= 0) { throw new IllegalArgumentException("invalid sample rate: " +((format.getSampleRate()==-1)? "NOT_SPECIFIED":String.valueOf(format.getSampleRate()))); } if (format.getSampleSizeInBits() <= 0) { throw new IllegalArgumentException("invalid sample size in bits: " +((format.getSampleSizeInBits()==-1)? "NOT_SPECIFIED":String.valueOf(format.getSampleSizeInBits()))); } if (format.getChannels() <= 0) { throw new IllegalArgumentException("invalid number of channels: " +((format.getChannels()==-1)? "NOT_SPECIFIED":String.valueOf(format.getChannels()))); } } static boolean isFullySpecifiedPCMFormat(AudioFormat format) { if (!format.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED) && !format.getEncoding().equals(AudioFormat.Encoding.PCM_UNSIGNED)) { return false; } if ((format.getFrameRate() <= 0) || (format.getSampleRate() <= 0) || (format.getSampleSizeInBits() <= 0) || (format.getFrameSize() <= 0) || (format.getChannels() <= 0)) { return false; } return true; } public static AudioInputStream getPCMConvertedAudioInputStream(AudioInputStream ais) { // we can't open the device for non-PCM playback, so we have // convert any other encodings to PCM here (at least we try!) AudioFormat af = ais.getFormat(); if( (!af.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED)) && (!af.getEncoding().equals(AudioFormat.Encoding.PCM_UNSIGNED))) { try { AudioFormat newFormat = new AudioFormat( AudioFormat.Encoding.PCM_SIGNED, af.getSampleRate(), 16, af.getChannels(), af.getChannels() * 2, af.getSampleRate(), Platform.isBigEndian()); ais = AudioSystem.getAudioInputStream(newFormat, ais); } catch (Exception e) { if (Printer.err) e.printStackTrace(); ais = null; } } return ais; } }
⏎ com/sun/media/sound/Toolkit.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, 34000👍, 0💬
Popular Posts:
GJT (Giant Java Tree) implementation of XML Pull Parser. JAR File Size and Download Location: File n...
How to download and install ojdbc11.jar for Oracle 21c? ojdbc11.jar for Oracle 21c is a Java JDBC Dr...
What is the sax\Counter.java provided in the Apache Xerces package? I have Apache Xerces 2.11.0 inst...
Old version of xml-apis.jar. JAR File Size and Download Location: File name: xmlParserAPIs.jar File ...
JDK 11 jdk.internal.JVM Stat.jmod is the JMOD file for JDK 11 Internal Jvmstat module. JDK 11 Intern...