}
finally
{
if (this.deviceSession == null)
{
throw new MediaException(
"Failed to create MediaDeviceSession from"
+ " AudioMixerMediaDevice for the purposes of"
+ " recording");
}
}
Throwable exception = null;
try
{
DataSource outputDataSource
= deviceSession.getOutputDataSource();
DataSink sink
= Manager.createDataSink(
outputDataSource,
new MediaLocator("file:" + filename));
sink.open();
sink.start();
this.sink = sink;
}
catch (NoDataSinkException ndsex)
{
exception = ndsex;
}
finally
{
if ((this.sink == null) || (exception != null))
{
stop();
throw new MediaException(
"Failed to start recording into file " + filename,
exception);
}
}