You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to use the DRED of opus 1.5 in my real-time intercom software, and used the way in the demo to simulate the packet loss.
I observed the log and found that when I started to speak, and there was packet loss, the normal call [opus_dred_parse], its return value has always been 0, so the decoder will only call [opus_decode].
However when I stop talking, the [opus_dred_parse] will return a positive number, and then use [opus_ decoder_dred_decode] to decode the packet, I don't understand why, is this the right situation? thanks!
lost = (packet_loss_perc>0) && (rand()%100 < packet_loss_perc);
}
if (len == 0) lost = 1;
if (lost)
{
lost_count++;
run_decoder = 0;
} else {
run_decoder= 1;
}
if (run_decoder)
run_decoder += lost_count;
if (!lost && lost_count > 0) {
opus_int32 output_samples=0;
opus_decoder_ctl(dec, OPUS_GET_LAST_PACKET_DURATION(&output_samples));
dred_input = lost_count*output_samples;
/* Only decode the amount we need to fill in the gap. */
ret = opus_dred_parse(dred_dec, dred, data, len, IMIN(48000, IMAX(0, dred_input)), sampling_rate, &dred_end, 0);
dred_input = ret > 0 ? ret : 0;
}
/* FIXME: Figure out how to trigger the decoder when the last packet of the file is lost. */
for (fr=0;fr<run_decoder;fr++) {
opus_int32 output_samples=0;
if (fr == lost_count-1 && opus_packet_has_lbrr(data, len)) {
opus_decoder_ctl(dec, OPUS_GET_LAST_PACKET_DURATION(&output_samples));
output_samples = opus_decode(dec, data, len, out, output_samples, 1);
} else if (fr < lost_count) {
opus_decoder_ctl(dec, OPUS_GET_LAST_PACKET_DURATION(&output_samples));
if (dred_input > 0)
output_samples = opus_decoder_dred_decode(dec, dred, (lost_count-fr)*output_samples, out, output_samples);
else
output_samples = opus_decode(dec, NULL, 0, out, output_samples, 0);
} else {
output_samples = max_frame_size;
output_samples = opus_decode(dec, data, len, out, output_samples, 0);
}
The text was updated successfully, but these errors were encountered:
sayakasama
changed the title
Opus 1.5 DRED and inbandFEC
how to use Opus 1.5 DRED?
Nov 1, 2024
I try to use it in my project, but it is really easy.
To let opus encode dred data, I disabled the FEC and set bitrates to 32000, then opus can encode two chunks.
Then follow the sample code, I can decode the DRED data, but the voice quality seems not as I expected.
I am still woking on it, hoping a good result.
I try to use it in my project, but it is really easy. To let opus encode dred data, I disabled the FEC and set bitrates to 32000, then opus can encode two chunks. Then follow the sample code, I can decode the DRED data, but the voice quality seems not as I expected. I am still woking on it, hoping a good result.
Thank u for your reply.
I think i have the same doubts as you.I feel like I've enabled dred, but the audio quality isn't what I expected, so I wonder if I'm using it wrong.
I tried to use the DRED of opus 1.5 in my real-time intercom software, and used the way in the demo to simulate the packet loss.
I observed the log and found that when I started to speak, and there was packet loss, the normal call [opus_dred_parse], its return value has always been 0, so the decoder will only call [opus_decode].
However when I stop talking, the [opus_dred_parse] will return a positive number, and then use [opus_ decoder_dred_decode] to decode the packet, I don't understand why, is this the right situation? thanks!
The text was updated successfully, but these errors were encountered: