summary refs log tree commit diff
path: root/pkgs/development/libraries/pocketsphinx/default.nix
blob: 71b36cedb81de7d0050f3cbb5b667f69272b2749 (plain) (blame)
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
{ stdenv
, fetchurl
, sphinxbase
, pkg-config
, python27 # >= 2.6
, swig2 # 2.0
}:

stdenv.mkDerivation rec {
  name = "pocketsphinx-5prealpha";

  src = fetchurl {
    url = "mirror://sourceforge/cmusphinx/${name}.tar.gz";
    sha256 = "1n9yazzdgvpqgnfzsbl96ch9cirayh74jmpjf7svs4i7grabanzg";
  };

  propagatedBuildInputs = [ sphinxbase ];

  nativeBuildInputs = [ pkg-config ];
  buildInputs = [ python27 swig2 ];

  meta = {
    description = "Voice recognition library written in C";
    homepage = "http://cmusphinx.sourceforge.net";
    license = stdenv.lib.licenses.free;
    platforms = stdenv.lib.platforms.linux;
  };
}

/* Example usage:


1.

$ cat << EOF > vocabulary.txt
oh mighty computer /1e-40/
hello world /1e-30/
EOF

2.

$ pocketsphinx_continuous -inmic yes -kws vocabulary.txt 2> /dev/null
# after you say "hello world":
hello world
...

*/