使用双簧管时,设置输入和输出流时通道数是否可能不匹配?

When using oboe is it possible to mismatch channel count when setting up input and output stream?

使用Android双簧管库时,是否可以设置输入通道为单声道输出通道为立体声?然后使用Mono to Stereo conversion?

中给出的类似方法将单声道样本值写入立体声输出通道

没有任何转换,直接将通道设置为单声道和立体声会导致输出高音调。

is it possible to set the input channel to be mono and the output channel to be stereo?

是的,您可以将频道数设置为您喜欢的任何值,但如果您将其设置为某个奇怪的值,则不能保证流会真正打开。

And then write the mono sample values to the stereo output channel through using a similar method given in Mono to Stereo conversion?

是的,这也行。将单声道流中的每个样本两次写入立体声流。

Without any conversion and directly setting the channels to be mono and stereo results in the output to be high pitched.

这是意料之中的,因为立体声流以两倍的速率渲染样本,因此输出频率 = 2 * 输入频率。

您最好打开具有相同通道数的输入和输出流,然后让 Oboe 为您进行转换。惯例是先打开输出流而不指定通道数,然后明确指定输入流的通道数。此处示例:https://github.com/google/oboe/blob/master/samples/LiveEffect/src/main/cpp/LiveEffectEngine.cpp#L81