I'm trying to write something like Perl Audio Converter, so I need to be able to decode every relevant audio format to wav (PCM) and then encode wav to every relevant audio format. I'd like to do this in parallel, by piping the output of the decoder directly to the input of the encoder. Most decoders have an option to decode to stdout, but not all of them do. Some insist on outputting to a file.
So my question is, how can I trick a program that will only output to a specified file into using stdout instead? Also, the complementary question: how can I trick a program that requires in input file into reading from stdin?
Would this be impossible because the program might want to seek back and forth within the output?
Incidentally, Perl Audio Converter sidesteps this problem by always using an intermediate wav file, which means that it never does decoding and encoding in parallel, even for formats that support it.
PS: Yes, there's a reason I don't want to just use Perl Audio Converter, but it's not relevant to the question.