I would like to use some features of TarsosDSP on sound data. The incoming data is Stereo, but Tarsos does only support mono, so I tried to transfer it to mono as follows, but the result still sounds like stereo data interpreted as mono, i.e. the conversion via MultichannelToMono
doesn't seem to have any effect, although its implementation looks good upon a quick glance.
@Test
public void testPlayStereoFile() throws IOException, UnsupportedAudioFileException, LineUnavailableException {
AudioDispatcher dispatcher = AudioDispatcherFactory.fromFile(FILE,4096,0);
dispatcher.addAudioProcessor(new MultichannelToMono(dispatcher.getFormat().getChannels(), false));
dispatcher.addAudioProcessor(new AudioPlayer(dispatcher.getFormat()));
dispatcher.run();
}
Is there anything that I do wrong here? Why does the MultichannelToMono
processor not transfer the data to mono?