MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / reset

Method reset

src/framework/audio/rnnoise.cpp:1468–1478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1466RnnoiseStreamingSession & RnnoiseStreamingSession::operator=(RnnoiseStreamingSession &&) noexcept = default;
1467
1468void RnnoiseStreamingSession::reset() {
1469 if (state_ == nullptr) {
1470 throw std::runtime_error("RNNoise streaming session is not initialized");
1471 }
1472 std::fill(state_->conv1_memory.begin(), state_->conv1_memory.end(), 0.0f);
1473 std::fill(state_->conv2_memory.begin(), state_->conv2_memory.end(), 0.0f);
1474 std::fill(state_->gru1_hidden.begin(), state_->gru1_hidden.end(), 0.0f);
1475 std::fill(state_->gru2_hidden.begin(), state_->gru2_hidden.end(), 0.0f);
1476 std::fill(state_->gru3_hidden.begin(), state_->gru3_hidden.end(), 0.0f);
1477 reset_audio_dsp_state(state_->dsp);
1478}
1479
1480RnnoiseFrameOutput RnnoiseStreamingSession::process_frame(const float * features, int64_t feature_size) {
1481 if (features == nullptr || weights_ == nullptr || state_ == nullptr) {

Callers 14

FlashSrGraphMethod · 0.45
load_from_directoryMethod · 0.45
RnnoiseFrameGraphMethod · 0.45
RnnoiseSequenceGraphMethod · 0.45
load_from_safetensorsMethod · 0.45
infer_featuresMethod · 0.45
process_mono_48kMethod · 0.45
run_mono_48k_wholeFunction · 0.45
load_from_directoryMethod · 0.45
run_featuresMethod · 0.45

Calls 3

reset_audio_dsp_stateFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected