Java Code Examples for javax.sound.sampled.AudioSystem#getTargetEncodings()
The following examples show how to use
javax.sound.sampled.AudioSystem#getTargetEncodings() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PCM_FLOAT_support.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { // 1st checks Encoding.PCM_FLOAT is available pcmFloatEnc = Encoding.PCM_FLOAT; Encoding[] encodings = AudioSystem.getTargetEncodings(pcmFloatEnc); out("conversion from PCM_FLOAT to " + encodings.length + " encodings:"); for (Encoding e: encodings) { out(" - " + e); } if (encodings.length == 0) { testFailed = true; } test(Encoding.PCM_SIGNED); test(Encoding.PCM_UNSIGNED); if (testFailed) { throw new Exception("test failed"); } out("test passed."); }
Example 2
Source File: PCM_FLOAT_support.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { // 1st checks Encoding.PCM_FLOAT is available pcmFloatEnc = Encoding.PCM_FLOAT; Encoding[] encodings = AudioSystem.getTargetEncodings(pcmFloatEnc); out("conversion from PCM_FLOAT to " + encodings.length + " encodings:"); for (Encoding e: encodings) { out(" - " + e); } if (encodings.length == 0) { testFailed = true; } test(Encoding.PCM_SIGNED); test(Encoding.PCM_UNSIGNED); if (testFailed) { throw new Exception("test failed"); } out("test passed."); }
Example 3
Source File: PCM_FLOAT_support.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { // 1st checks Encoding.PCM_FLOAT is available pcmFloatEnc = Encoding.PCM_FLOAT; Encoding[] encodings = AudioSystem.getTargetEncodings(pcmFloatEnc); out("conversion from PCM_FLOAT to " + encodings.length + " encodings:"); for (Encoding e: encodings) { out(" - " + e); } if (encodings.length == 0) { testFailed = true; } test(Encoding.PCM_SIGNED); test(Encoding.PCM_UNSIGNED); if (testFailed) { throw new Exception("test failed"); } out("test passed."); }
Example 4
Source File: PCM_FLOAT_support.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { // 1st checks Encoding.PCM_FLOAT is available pcmFloatEnc = Encoding.PCM_FLOAT; Encoding[] encodings = AudioSystem.getTargetEncodings(pcmFloatEnc); out("conversion from PCM_FLOAT to " + encodings.length + " encodings:"); for (Encoding e: encodings) { out(" - " + e); } if (encodings.length == 0) { testFailed = true; } test(Encoding.PCM_SIGNED); test(Encoding.PCM_UNSIGNED); if (testFailed) { throw new Exception("test failed"); } out("test passed."); }
Example 5
Source File: PCM_FLOAT_support.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { // 1st checks Encoding.PCM_FLOAT is available pcmFloatEnc = Encoding.PCM_FLOAT; Encoding[] encodings = AudioSystem.getTargetEncodings(pcmFloatEnc); out("conversion from PCM_FLOAT to " + encodings.length + " encodings:"); for (Encoding e: encodings) { out(" - " + e); } if (encodings.length == 0) { testFailed = true; } test(Encoding.PCM_SIGNED); test(Encoding.PCM_UNSIGNED); if (testFailed) { throw new Exception("test failed"); } out("test passed."); }
Example 6
Source File: PCM_FLOAT_support.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { // 1st checks Encoding.PCM_FLOAT is available pcmFloatEnc = Encoding.PCM_FLOAT; Encoding[] encodings = AudioSystem.getTargetEncodings(pcmFloatEnc); out("conversion from PCM_FLOAT to " + encodings.length + " encodings:"); for (Encoding e: encodings) { out(" - " + e); } if (encodings.length == 0) { testFailed = true; } test(Encoding.PCM_SIGNED); test(Encoding.PCM_UNSIGNED); if (testFailed) { throw new Exception("test failed"); } out("test passed."); }
Example 7
Source File: PCM_FLOAT_support.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { // 1st checks Encoding.PCM_FLOAT is available pcmFloatEnc = Encoding.PCM_FLOAT; Encoding[] encodings = AudioSystem.getTargetEncodings(pcmFloatEnc); out("conversion from PCM_FLOAT to " + encodings.length + " encodings:"); for (Encoding e: encodings) { out(" - " + e); } if (encodings.length == 0) { testFailed = true; } test(Encoding.PCM_SIGNED); test(Encoding.PCM_UNSIGNED); if (testFailed) { throw new Exception("test failed"); } out("test passed."); }
Example 8
Source File: PCM_FLOAT_support.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { // 1st checks Encoding.PCM_FLOAT is available pcmFloatEnc = Encoding.PCM_FLOAT; Encoding[] encodings = AudioSystem.getTargetEncodings(pcmFloatEnc); out("conversion from PCM_FLOAT to " + encodings.length + " encodings:"); for (Encoding e: encodings) { out(" - " + e); } if (encodings.length == 0) { testFailed = true; } test(Encoding.PCM_SIGNED); test(Encoding.PCM_UNSIGNED); if (testFailed) { throw new Exception("test failed"); } out("test passed."); }
Example 9
Source File: PCM_FLOAT_support.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { // 1st checks Encoding.PCM_FLOAT is available pcmFloatEnc = Encoding.PCM_FLOAT; Encoding[] encodings = AudioSystem.getTargetEncodings(pcmFloatEnc); out("conversion from PCM_FLOAT to " + encodings.length + " encodings:"); for (Encoding e: encodings) { out(" - " + e); } if (encodings.length == 0) { testFailed = true; } test(Encoding.PCM_SIGNED); test(Encoding.PCM_UNSIGNED); if (testFailed) { throw new Exception("test failed"); } out("test passed."); }
Example 10
Source File: PCM_FLOAT_support.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { // 1st checks Encoding.PCM_FLOAT is available pcmFloatEnc = Encoding.PCM_FLOAT; Encoding[] encodings = AudioSystem.getTargetEncodings(pcmFloatEnc); out("conversion from PCM_FLOAT to " + encodings.length + " encodings:"); for (Encoding e: encodings) { out(" - " + e); } if (encodings.length == 0) { testFailed = true; } test(Encoding.PCM_SIGNED); test(Encoding.PCM_UNSIGNED); if (testFailed) { throw new Exception("test failed"); } out("test passed."); }
Example 11
Source File: PCM_FLOAT_support.java From hottub with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { // 1st checks Encoding.PCM_FLOAT is available pcmFloatEnc = Encoding.PCM_FLOAT; Encoding[] encodings = AudioSystem.getTargetEncodings(pcmFloatEnc); out("conversion from PCM_FLOAT to " + encodings.length + " encodings:"); for (Encoding e: encodings) { out(" - " + e); } if (encodings.length == 0) { testFailed = true; } test(Encoding.PCM_SIGNED); test(Encoding.PCM_UNSIGNED); if (testFailed) { throw new Exception("test failed"); } out("test passed."); }
Example 12
Source File: PCM_FLOAT_support.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
static boolean test(Encoding enc) { out("conversion " + enc + " -> PCM_FLOAT:"); Encoding[] encodings = AudioSystem.getTargetEncodings(enc); for (Encoding e: encodings) { if (e.equals(pcmFloatEnc)) { out(" - OK"); return true; } } out(" - FAILED (not supported)"); testFailed = true; return false; }
Example 13
Source File: PCM_FLOAT_support.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
static boolean test(Encoding enc) { out("conversion " + enc + " -> PCM_FLOAT:"); Encoding[] encodings = AudioSystem.getTargetEncodings(enc); for (Encoding e: encodings) { if (e.equals(pcmFloatEnc)) { out(" - OK"); return true; } } out(" - FAILED (not supported)"); testFailed = true; return false; }
Example 14
Source File: MidiToAudioSettingsDialog.java From tuxguitar with GNU Lesser General Public License v2.1 | 5 votes |
public List<MidiToAudioFormat> getAvailableFormats(){ List<MidiToAudioFormat> list = new ArrayList<MidiToAudioFormat>(); AudioFormat srcFormat = MidiToAudioSettings.DEFAULT_FORMAT; AudioFormat.Encoding[] encodings = AudioSystem.getTargetEncodings(srcFormat); for( int i = 0 ; i < encodings.length ; i ++ ){ AudioFormat dstFormat = new AudioFormat(encodings[i],srcFormat.getSampleRate(),srcFormat.getSampleSizeInBits(),srcFormat.getChannels(),srcFormat.getFrameSize(),srcFormat.getFrameRate(),srcFormat.isBigEndian()); AudioInputStream dstStream = new AudioInputStream(null, dstFormat, 0); AudioFileFormat.Type[] dstTypes = AudioSystem.getAudioFileTypes(dstStream); if( dstTypes.length > 0 ){ list.add( new MidiToAudioFormat( dstFormat , dstTypes )); } } return list; }
Example 15
Source File: PCM_FLOAT_support.java From hottub with GNU General Public License v2.0 | 5 votes |
static boolean test(Encoding enc) { out("conversion " + enc + " -> PCM_FLOAT:"); Encoding[] encodings = AudioSystem.getTargetEncodings(enc); for (Encoding e: encodings) { if (e.equals(pcmFloatEnc)) { out(" - OK"); return true; } } out(" - FAILED (not supported)"); testFailed = true; return false; }
Example 16
Source File: PCM_FLOAT_support.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
static boolean test(Encoding enc) { out("conversion " + enc + " -> PCM_FLOAT:"); Encoding[] encodings = AudioSystem.getTargetEncodings(enc); for (Encoding e: encodings) { if (e.equals(pcmFloatEnc)) { out(" - OK"); return true; } } out(" - FAILED (not supported)"); testFailed = true; return false; }
Example 17
Source File: PCM_FLOAT_support.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
static boolean test(Encoding enc) { out("conversion " + enc + " -> PCM_FLOAT:"); Encoding[] encodings = AudioSystem.getTargetEncodings(enc); for (Encoding e: encodings) { if (e.equals(pcmFloatEnc)) { out(" - OK"); return true; } } out(" - FAILED (not supported)"); testFailed = true; return false; }
Example 18
Source File: PCM_FLOAT_support.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
static boolean test(Encoding enc) { out("conversion " + enc + " -> PCM_FLOAT:"); Encoding[] encodings = AudioSystem.getTargetEncodings(enc); for (Encoding e: encodings) { if (e.equals(pcmFloatEnc)) { out(" - OK"); return true; } } out(" - FAILED (not supported)"); testFailed = true; return false; }
Example 19
Source File: PCM_FLOAT_support.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
static boolean test(Encoding enc) { out("conversion " + enc + " -> PCM_FLOAT:"); Encoding[] encodings = AudioSystem.getTargetEncodings(enc); for (Encoding e: encodings) { if (e.equals(pcmFloatEnc)) { out(" - OK"); return true; } } out(" - FAILED (not supported)"); testFailed = true; return false; }
Example 20
Source File: PCM_FLOAT_support.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
static boolean test(Encoding enc) { out("conversion " + enc + " -> PCM_FLOAT:"); Encoding[] encodings = AudioSystem.getTargetEncodings(enc); for (Encoding e: encodings) { if (e.equals(pcmFloatEnc)) { out(" - OK"); return true; } } out(" - FAILED (not supported)"); testFailed = true; return false; }