daisy / pipeline-mod-audio

!! NOTE: This project is now part of the pipeline-modules project !! | Audio-related modules for the DAISY Pipeline 2
0 stars 0 forks source link

Broken pipe in LameEncoder when output directory is invalid #15

Open rom1mouret opened 9 years ago

rom1mouret commented 9 years ago

If a user sets a custom temporary directory that doesn't exist, Lame will throw an unintuitive exception:

java.io.IOException: Broken pipe
        at java.io.FileOutputStream.writeBytes(Native Method)
        at java.io.FileOutputStream.write(FileOutputStream.java:345)
        at java.io.BufferedOutputStream.write(BufferedOutputStream.java:122)
        at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
        at java.io.BufferedOutputStream.write(BufferedOutputStream.java:126)
        at org.daisy.pipeline.audio.lame.LameEncoder.encode(LameEncoder.java:110)
        at org.daisy.pipeline.tts.synthesize.EncodingThread$1.run(EncodingThread.java:93)

It should be replaced with something that says that the directory doesn't exist.

rdeltour commented 9 years ago

@rom1mouret Just checking before you leave: is it stil the case with the refactored code?

rom1mouret commented 9 years ago

Yes, it is still a problem. Thanks to the refactored code, the error will be caught and logged, but the directory should be tested nonetheless.