sembra che si determina here:
if (st->force_channels!=OPUS_AUTO && st->channels == 2)
{
st->stream_channels = st->force_channels;
} else {
#ifdef FUZZING
/* Random mono/stereo decision */
if (st->channels == 2 && (rand()&0x1F)==0)
st->stream_channels = 3-st->stream_channels;
#else
/* Rate-dependent mono-stereo decision */
if (st->channels == 2)
{
opus_int32 stereo_threshold;
stereo_threshold = stereo_music_threshold + ((voice_est*voice_est*(stereo_voice_threshold-stereo_music_threshold))>>14);
if (st->stream_channels == 2)
stereo_threshold -= 4000;
else
stereo_threshold += 4000;
st->stream_channels = (equiv_rate > stereo_threshold) ? 2 : 1;
} else {
st->stream_channels = st->channels;
}
#endif
}
Proprio breifly lettura attraverso il codice sorgente opusenc, sembra che l'impostazione force_channels
a 2 sui struct OpusEncoder
sarà fallo funzionare. Tuttavia, guardando attraverso il codice sorgente opusenc.c, non è dove è impostato quel campo. È comunque possibile modificare facilmente la sorgente per forzare sempre i canali a essere due. Per il futuro, sembra che l'opus la chiami "dual stereo" piuttosto che "L/R stereo".
fonte
2014-04-12 06:02:06
Stavo testando questo codificando un file con separazione stereo molto alta e ascoltando il risultato. I canali erano nettamente separati con la codifica predefinita. –