add configure option '--enable-int-audio-sample' for speed and audio driver compatibility, and fixups in exports and webrtc.

This commit is contained in:
roytam1 2023-08-19 06:41:26 +08:00
commit ef5e4f06e0
4 changed files with 37 additions and 1 deletions

View file

@ -32,7 +32,9 @@ AudioClassifier::AudioClassifier()
kDefaultFrameSizeSamples,
NULL)) {
assert(celt_mode_);
#ifndef MOZ_SAMPLE_TYPE_S16
tonality_analysis_init(&analysis_state_, kDefaultSampleRateHz);
#endif
}
AudioClassifier::~AudioClassifier() {}
@ -46,6 +48,7 @@ bool AudioClassifier::Analysis(const int16_t* input,
// Only mono or stereo are allowed.
assert(channels == 1 || channels == 2);
#ifndef MOZ_SAMPLE_TYPE_S16
// Call Opus' classifier, defined in
// "third_party/opus/src/src/analysis.h", with lsb_depth = 16.
// Also uses a down-mixing function downmix_int, defined in
@ -65,6 +68,9 @@ bool AudioClassifier::Analysis(const int16_t* input,
&analysis_info_);
music_probability_ = analysis_info_.music_prob;
is_music_ = music_probability_ > kDefaultThreshold;
#else
is_music_ = false;
#endif
return is_music_;
}