I am trying to take an online MP3 (icecast) stream which plays one thing on the left, and another thing on the right and split that into 2 separate files. I transferred the stream to a wav file that keeps growing. Now I want to save 2 additional files for the two separate channels. I found some other solutions around the web but they only seem to work for full wav files, but because it is a live stream and the file keeps growing they didn't work for this.
I am trying to do this in Java.
Just shell out to FFmpeg. This is trivial to do there.
ffmpeg -i <your stream> -map_channel 0.0.0 left.wav -map_channel 0.0.1 right.wav
See also: https://trac.ffmpeg.org/wiki/AudioChannelManipulation