lol

piper-phonemize: init at 1.1.0

C++ library for converting text to phonemes for Piper

+100
+73
pkgs/development/libraries/piper-phonemize/default.nix
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + 5 + # build 6 + , cmake 7 + , pkg-config 8 + 9 + # runtime 10 + , espeak-ng 11 + , onnxruntime 12 + }: 13 + 14 + let 15 + espeak-ng' = espeak-ng.overrideAttrs (oldAttrs: { 16 + version = "1.52-dev"; 17 + src = fetchFromGitHub { 18 + owner = "rhasspy"; 19 + repo = "espeak-ng"; 20 + rev = "61504f6b76bf9ebbb39b07d21cff2a02b87c99ff"; 21 + hash = "sha256-RBHL11L5uazAFsPFwul2QIyJREXk9Uz8HTZx9JqmyIQ="; 22 + }; 23 + 24 + patches = [ 25 + ./espeak-mbrola.patch 26 + ]; 27 + }); 28 + in 29 + stdenv.mkDerivation rec { 30 + pname = "piper-phonemize"; 31 + version = "1.1.0"; 32 + 33 + src = fetchFromGitHub { 34 + owner = "rhasspy"; 35 + repo = "piper-phonemize"; 36 + rev = "refs/tags/v${version}"; 37 + hash = "sha256-cMer7CSLOXv3jc9huVA3Oy5cjXjOX9XuEXpIWau1BNQ="; 38 + }; 39 + 40 + outputs = [ 41 + "out" 42 + "dev" 43 + ]; 44 + 45 + nativeBuildInputs = [ 46 + cmake 47 + pkg-config 48 + ]; 49 + 50 + buildInputs = [ 51 + espeak-ng' 52 + onnxruntime 53 + ]; 54 + 55 + ainstallPhase = '' 56 + runHook preInstall 57 + 58 + install -d $out/lib 59 + install ./libpiper_phonemize.so $out/lib 60 + 61 + install -d $dev/include/piper_phonemize 62 + install -D ../src/*.hpp $dev/include 63 + 64 + runHook postInstall 65 + ''; 66 + 67 + meta = with lib; { 68 + description = "C++ library for converting text to phonemes for Piper"; 69 + homepage = "https://github.com/rhasspy/piper-phonemize"; 70 + license = licenses.mit; 71 + maintainers = with maintainers; [ hexa ]; 72 + }; 73 + }
+26
pkgs/development/libraries/piper-phonemize/espeak-mbrola.patch
··· 1 + diff --git a/src/libespeak-ng/mbrowrap.c b/src/libespeak-ng/mbrowrap.c 2 + index ae137873..9015cc01 100644 3 + --- a/src/libespeak-ng/mbrowrap.c 4 + +++ b/src/libespeak-ng/mbrowrap.c 5 + @@ -206,7 +206,7 @@ static int start_mbrola(const char *voice_path) 6 + signal(SIGTERM, SIG_IGN); 7 + 8 + snprintf(charbuf, sizeof(charbuf), "%g", mbr_volume); 9 + - execlp("mbrola", "mbrola", "-e", "-v", charbuf, 10 + + execlp("@mbrola/bin/mbrola", "mbrola", "-e", "-v", charbuf, 11 + voice_path, "-", "-.wav", (char *)NULL); 12 + /* if execution reaches this point then the exec() failed */ 13 + snprintf(mbr_errorbuf, sizeof(mbr_errorbuf), 14 + diff --git a/src/libespeak-ng/synth_mbrola.c b/src/libespeak-ng/synth_mbrola.c 15 + index 734631b7..46d1f13e 100644 16 + --- a/src/libespeak-ng/synth_mbrola.c 17 + +++ b/src/libespeak-ng/synth_mbrola.c 18 + @@ -85,7 +85,7 @@ espeak_ng_STATUS LoadMbrolaTable(const char *mbrola_voice, const char *phtrans, 19 + if (!load_MBR()) 20 + return ENS_MBROLA_NOT_FOUND; 21 + 22 + - sprintf(path, "%s/mbrola/%s", path_home, mbrola_voice); 23 + + sprintf(path, "@mbrola@/share/mbrola/voices/%s/%s", mbrola_voice, mbrola_voice); 24 + #if PLATFORM_POSIX 25 + // if not found, then also look in 26 + // usr/share/mbrola/xx, /usr/share/mbrola/xx/xx, /usr/share/mbrola/voices/xx
+1
pkgs/top-level/all-packages.nix
··· 11708 11708 11709 11709 pim6sd = callPackage ../servers/pim6sd { }; 11710 11710 11711 + piper-phonemize = callPackage ../development/libraries/piper-phonemize { }; 11711 11712 piper-train = with python3Packages; toPythonApplication piper-train; 11712 11713 piper-tts = callPackage ../tools/audio/piper { }; 11713 11714