summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/noisereduce/default.nix
blob: 269d8db25d17d928e89241b679884e8dcf5d7a3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  joblib,
  matplotlib,
  numpy,
  pytestCheckHook,
  scipy,
  setuptools,
  torch,
  tqdm,
}:

buildPythonPackage rec {
  pname = "noisereduce";
  version = "3.0.3";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "timsainb";
    repo = "noisereduce";
    tag = "v${version}";
    hash = "sha256-CMXbl+9L01rtsD8BZ3nNomacsChy/1EGdUdWz7Ytbjk=";
  };

  build-system = [ setuptools ];

  dependencies = [
    joblib
    matplotlib
    numpy
    scipy
    tqdm
  ];

  optional-dependencies = {
    PyTorch = [ torch ];
  };

  nativeCheckInputs = [ pytestCheckHook ] ++ lib.concatAttrValues optional-dependencies;

  pythonImportsCheck = [ "noisereduce" ];

  meta = {
    description = "Noise reduction using spectral gating (speech, bioacoustics, audio, time-domain signals";
    homepage = "https://github.com/timsainb/noisereduce";
    changelog = "https://github.com/timsainb/noisereduce/releases/tag/${src.tag}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ fab ];
  };
}