A
Andrew Thompson
What should an AudioFileReader.getAudioInputStream(InputStream)*
do/throw when it encounters an unrecognized stream?
The JavaDocs declare that it throws an UnsupportedAudioFileException.
* <http://java.sun.com/javase/6/docs/api/javax/sound/sampled/spi/
AudioFileReader.html#getAudioInputStream(java.io.InputStream)>
I am developing a new sound format. After some months of wrangling
with the build tools to get an app. that correctly registers a new
audio
type via the ServiceProvider interface (fixed in the end, by upgrading
to
the latest version of Ant), I am now puzzling over what to do when
the
new class is handed an audio stream that is handled by one of the
*pre-existing* formats.
If I throw an UnsupportedAudioFileException when handed a format
that is not the new one, the app. can no longer read existing formats.
If I fail to throw an UAFE, my class is left trying to deal with data
for which it was not designed, and cannot cope.
Anybody encountered this before / have any tips on how to proceed?
do/throw when it encounters an unrecognized stream?
The JavaDocs declare that it throws an UnsupportedAudioFileException.
* <http://java.sun.com/javase/6/docs/api/javax/sound/sampled/spi/
AudioFileReader.html#getAudioInputStream(java.io.InputStream)>
I am developing a new sound format. After some months of wrangling
with the build tools to get an app. that correctly registers a new
audio
type via the ServiceProvider interface (fixed in the end, by upgrading
to
the latest version of Ant), I am now puzzling over what to do when
the
new class is handed an audio stream that is handled by one of the
*pre-existing* formats.
If I throw an UnsupportedAudioFileException when handed a format
that is not the new one, the app. can no longer read existing formats.
If I fail to throw an UAFE, my class is left trying to deal with data
for which it was not designed, and cannot cope.
Anybody encountered this before / have any tips on how to proceed?