![]() |
The Java Developers Almanac 1.4 |
|
e727. Determining the Encoding of a Sampled Audio File try {
// From file
AudioInputStream stream = AudioSystem.getAudioInputStream(new File("audiofile"));
// From URL
stream = AudioSystem.getAudioInputStream(new URL("http://hostname/audiofile"));
AudioFormat format = stream.getFormat();
if (format.getEncoding() == AudioFormat.Encoding.ULAW) {
} else if (format.getEncoding() == AudioFormat.Encoding.ULAW) {
}
} catch (MalformedURLException e) {
} catch (IOException e) {
} catch (UnsupportedAudioFileException e) {
// Audio format is not supported.
}
e728. Determining the Duration of a Sampled Audio File e729. Determining the Position of a Sampled Audio Player e730. Setting the Volume of a Sampled Audio Player
© 2002 Addison-Wesley. |