1 7 8 package javax.sound.sampled.spi; 9 10 import java.io.File ; 11 import java.io.InputStream ; 12 import java.io.IOException ; 13 import java.io.OutputStream ; 14 15 import javax.sound.sampled.AudioFileFormat ; 16 import javax.sound.sampled.AudioInputStream ; 17 18 19 28 public abstract class AudioFileWriter { 29 30 36 public abstract AudioFileFormat.Type [] getAudioFileTypes(); 37 38 39 46 public boolean isFileTypeSupported(AudioFileFormat.Type fileType) { 47 48 AudioFileFormat.Type types[] = getAudioFileTypes(); 49 50 for(int i=0; i<types.length; i++) { 51 if( fileType.equals( types[i] ) ) { 52 return true; 53 } 54 } 55 return false; 56 } 57 58 59 67 public abstract AudioFileFormat.Type [] getAudioFileTypes(AudioInputStream stream); 68 69 70 78 public boolean isFileTypeSupported(AudioFileFormat.Type fileType, AudioInputStream stream) { 79 80 AudioFileFormat.Type types[] = getAudioFileTypes( stream ); 81 82 for(int i=0; i<types.length; i++) { 83 if( fileType.equals( types[i] ) ) { 84 return true; 85 } 86 } 87 return false; 88 } 89 90 91 110 public abstract int write(AudioInputStream stream, AudioFileFormat.Type fileType, OutputStream out) throws IOException ; 111 112 113 127 public abstract int write(AudioInputStream stream, AudioFileFormat.Type fileType, File out) throws IOException ; 128 129 130 } 131 | Popular Tags |