ChannelSplitOutput not extracting exact mono audio from stereo source. #2228
-
|
Hardware: ESP32-S3-Supermini To test the new ChannelSplitOutput class, I used a sine-to-serial sketch to convert the stereo output into 2 mono signals. However, the serial plotter shows 2 channels slightly diverging from each other and the serial output confirms the discrepancy in values. Note, the 2 lines do converge now and then before diverging again. SketchAs a comparison with FormatConverterStream class, the L/R channels in the plot overlay each other exactly so that only 1 line is seen. The serial output also shows same values for both channels. Sketch |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Actually the issue is, that you use the ChannelSplitOutput to send the output to the same output: this is not supported! This is writing the first 1k of data of the left channel followed by the next 1k of data of the right channel and then you print the first sample of the left channel as left channel sample and the second sample of the left channel as right channel sample.... You could try to make the copy size the sample size, but this will be very inefficient.... |
Beta Was this translation helpful? Give feedback.
-
|
Ok thanks, my misunderstanding of the ChannelSplitOutput class usage. On a separate note, I noticed a slight phase shift between the L/R channel output waveform if I wrap stereoToMonoConverter around monoToStereoConverter (compare the screenshot above and below). Commenting out the delay(200) in the loop made no difference. Sketch |
Beta Was this translation helpful? Give feedback.





Actually the issue is, that you use the ChannelSplitOutput to send the output to the same output: this is not supported!
You would need to send them to separate output objects!
This is writing the first 1k of data of the left channel followed by the next 1k of data of the right channel and then you print the first sample of the left channel as left channel sample and the second sample of the left channel as right channel sample....
You could try to make the copy size the sample size, but this will be very inefficient....