Voice isolation — separating clean speech from background noise and mixed audio.
Python
# Copyright 2026 Inworld AI
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""The DeepFilterNet3 wrapper renders every input.
It needs the pinned model folder.
"""
import pytest
import rundfn3
def test_every_input_is_rendered_under_a_receipt(tiny_set, run_wrapper):
in_dir, out_dir = tiny_set
calls = run_wrapper(rundfn3, in_dir, out_dir)
assert calls["exit"] == 0 and calls["begin"][0] == "dfn3"
assert len(list(out_dir.glob("*.wav"))) == 3
def test_a_missing_model_folder_stops_before_the_package_loads(
tmp_path, monkeypatch):
monkeypatch.setattr(rundfn3, "MODEL_DIR", str(tmp_path / "DeepFilterNet3"))
with pytest.raises(FileNotFoundError, match="setupfield"):
rundfn3.load("cpu")