Converting mono to one channel of stereo

Purpose. Converts mono audio or stereo file to a stereo audio file with the mono stream appearing either on the left or the right channel of the stereo stream, and the other channel muted. If the input is stereo, it is mixed down to a mono stream, which is then used as above. Besides the number of channels, the output file will have the same audio format as the input file.

Usage. 

java SingleChannelStereoConverter [[ -l ] | [ -r ]] input_file output_file

Parameters. 

-l

assigns the mono stream to the left channel

-r

assigns the mono stream to the right channel

input_file

the file name of the audio file that audio data should be read from. This can be a mono or a stereo file.

output_file

the file name of the audio file that audio data should be read from. This can be a mono or a stereo file.

Bugs, limitations. The converter processes only audio data in common PCM formats (8 bit unsigned, 16 bit signed). To process stereo input files, the PCM2PCM converter of Tritonus is required. You can download it from Tritonus Plug-ins.

Source code.  SingleChannelStereoConverter.java, SingleChannelStereoAudioInputStream.java, AudioCommon.java