I keep getting an exception when I close an IMediaWriter doing a simple transcode. The exception is "java.lang.RuntimeException: error Operation not permitted, failed to write trailer to test.mp3" I get this whenever I call IMediaWriter.close(),Any ideas why I would be getting this for a simple transcoding? Here's the sample code:
IMediaReader reader = null;
IMediaWriter writer = null;
try {
reader = ToolFactory.makeReader("test.wav");
writer = ToolFactory.makeWriter("test.mp3", reader);
reader.addListener(writer);
while (reader.readPacket() == null) ;
reader.close();
writer.close();
} catch (Exception ex) {
ex.printStackTrace();
}