modules/audio_coding/codecs/opus/opus_interface.c
/* For decoder to determine if it is to output speech or comfort noise. */
For decoder to determine if it is to output speech or comfort noise.
For decoder to determine if it is to output speech or comfort noise .
static int16_t DetermineAudioType(OpusDecInst* inst, size_t encoded_bytes) {
  if (encoded_bytes == 0 && inst->in_dtx_mode) {
    return 2;  
  } else if (encoded_bytes == 1 || encoded_bytes == 2) {
    inst->in_dtx_mode = 1;
    return 2;  
  } else {
    inst->in_dtx_mode = 0;
    return 0;  
  }
}
static int16_t DetermineAudioType ( OpusDecInst * inst , size_t encoded_bytes ) { if ( encoded_bytes == 0 && inst -> in_dtx_mode ) { return 2 ; } else if ( encoded_bytes == 1 || encoded_bytes == 2 ) { inst -> in_dtx_mode = 1 ; return 2 ; } else { inst -> in_dtx_mode = 0 ; return 0 ; } }
For decoder to determine if it is to output speech or comfort noise.
For decoder to determine if it is to output speech or comfort noise .
// Audio type becomes comfort noise if |encoded_byte| is 1 and keeps // to be so if the following |encoded_byte| are 0 or 1. // Comfort noise. // TODO(henrik.lundin): There is a slight risk that a 2-byte payload is in // fact a 1-byte TOC with a 1-byte payload. That will be erroneously // interpreted as comfort noise output, but such a payload is probably // faulty anyway. // TODO(webrtc:10218): This is wrong for multistream opus. Then are several // single-stream packets glued together with some packet size bytes in // between. See https://tools.ietf.org/html/rfc6716#appendix-B // Comfort noise. // Speech.