JizzBlobWriter blobOut) throws UnsupportedTrackTypeException {
// TODO Modify this to split the source and allow the encoding of
// multiple destinations
logger.trace("Looking up audio reader (decoder) for blob {}", blobIn);
CountingInputStream decodedIn = new CountingInputStream(
getDecodedInputStream(blobIn));
try {
logger.trace("Looking up audio writer (encoder) for decoded input "
+ "stream {}", decodedIn);
InputStream encodedIn = getEncodedInputStream(format, decodedIn);
OutputStream encodedOut = blobOut.getOutputStream();
try {
logger.trace("Doing the transcode from blob {} to blob {}",
blobIn, blobOut);
JizzServiceUtils.copy(encodedIn, encodedOut);
logger.trace("Success - transcoded");
int length = (int) (decodedIn.getByteCount() / JizzTrackAudioReader.FRAME_SIZE);
if (logger.isTraceEnabled()) {
logger.trace("Length in seconds of the stream is " + length
+ " based on number of bytes of "
+ decodedIn.getByteCount()
+ " in the decoded stream and a frame size of "
+ JizzTrackAudioReader.FRAME_SIZE);
}
return length;
} catch (IOException ioEx) {