2021-01-21 18:00:13 +01:00
|
|
|
{ lib, stdenv
|
2016-12-28 04:28:07 +01:00
|
|
|
, fetchurl
|
|
|
|
, sphinxbase
|
2021-01-19 07:50:56 +01:00
|
|
|
, pkg-config
|
2016-12-28 04:28:07 +01:00
|
|
|
, python27 # >= 2.6
|
|
|
|
, swig2 # 2.0
|
|
|
|
}:
|
2011-04-04 20:50:39 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-12-28 04:28:07 +01:00
|
|
|
name = "pocketsphinx-5prealpha";
|
2011-04-04 20:50:39 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/cmusphinx/${name}.tar.gz";
|
2016-12-28 04:28:07 +01:00
|
|
|
sha256 = "1n9yazzdgvpqgnfzsbl96ch9cirayh74jmpjf7svs4i7grabanzg";
|
2011-04-04 20:50:39 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ sphinxbase ];
|
|
|
|
|
2021-01-19 07:50:56 +01:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2017-09-05 23:26:13 +02:00
|
|
|
buildInputs = [ python27 swig2 ];
|
2011-04-04 20:50:39 +02:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Voice recognition library written in C";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://cmusphinx.sourceforge.net";
|
2021-01-21 18:00:13 +01:00
|
|
|
license = lib.licenses.free;
|
|
|
|
platforms = lib.platforms.linux;
|
2011-04-04 20:50:39 +02:00
|
|
|
};
|
|
|
|
}
|
2016-12-28 04:28:07 +01:00
|
|
|
|
|
|
|
/* 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
|
|
|
|
...
|
|
|
|
|
|
|
|
*/
|