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

Function reset_audio_dsp_state

src/framework/audio/rnnoise.cpp:684–700  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

682};
683
684void reset_audio_dsp_state(RnnoiseAudioDspState & state) {
685 std::fill(state.analysis_mem.begin(), state.analysis_mem.end(), 0.0f);
686 std::fill(state.synthesis_mem.begin(), state.synthesis_mem.end(), 0.0f);
687 std::fill(state.pitch_buf.begin(), state.pitch_buf.end(), 0.0f);
688 std::fill(state.highpass_mem.begin(), state.highpass_mem.end(), 0.0f);
689 std::fill(state.last_gains.begin(), state.last_gains.end(), 0.0f);
690 std::fill(state.delayed_x.begin(), state.delayed_x.end(), std::complex<float>{});
691 std::fill(state.delayed_p.begin(), state.delayed_p.end(), std::complex<float>{});
692 std::fill(state.delayed_ex.begin(), state.delayed_ex.end(), 0.0f);
693 std::fill(state.delayed_ep.begin(), state.delayed_ep.end(), 0.0f);
694 std::fill(state.delayed_exp.begin(), state.delayed_exp.end(), 0.0f);
695 std::fill(state.windowed.begin(), state.windowed.end(), 0.0f);
696 std::fill(state.pitch_frame.begin(), state.pitch_frame.end(), 0.0f);
697 std::fill(state.synthesized.begin(), state.synthesized.end(), 0.0f);
698 state.last_gain = 0.0f;
699 state.last_period = 0;
700}
701
702RnnoiseAnalyzedAudioFrame analyze_rnnoise_audio_frame(RnnoiseAudioDspState & state, const float * input) {
703 static const std::array<float, 2> a_hp = {-1.99599f, 0.99600f};

Callers 1

resetMethod · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected