sonify1026 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
snfy/__init__.py ADDED
@@ -0,0 +1,38 @@
1
+ """
2
+ Sonify 1026 Voice Engine
3
+ An expressive, adaptive Indian female TTS engine with emotion, accent,
4
+ prosody and EN/HI code-switching control.
5
+ """
6
+
7
+ from .engine import (
8
+ SonifyEngine,
9
+ BIOS02VoiceEngine,
10
+ Emotion,
11
+ Language,
12
+ Persona,
13
+ ProsodyParams,
14
+ SynthesisResult,
15
+ create_engine,
16
+ render,
17
+ render_arc,
18
+ speak,
19
+ REGISTERS,
20
+ DEFAULT_REGISTER,
21
+ )
22
+
23
+ __version__ = "0.1.0"
24
+ __all__ = [
25
+ "SonifyEngine",
26
+ "BIOS02VoiceEngine",
27
+ "Emotion",
28
+ "Language",
29
+ "Persona",
30
+ "ProsodyParams",
31
+ "SynthesisResult",
32
+ "create_engine",
33
+ "render",
34
+ "render_arc",
35
+ "speak",
36
+ "REGISTERS",
37
+ "DEFAULT_REGISTER",
38
+ ]
snfy/__main__.py ADDED
@@ -0,0 +1,39 @@
1
+ """
2
+ Sonify 1026 CLI - Run as: snfy "Hello world", or python -m snfy "Hello world"
3
+ """
4
+
5
+ import argparse
6
+ import sys
7
+ from .engine import SonifyEngine, Emotion
8
+
9
+
10
+ def main():
11
+ parser = argparse.ArgumentParser(description="Sonify 1026 Voice Engine CLI")
12
+ parser.add_argument("text", help="Text to synthesize")
13
+ parser.add_argument("--emotion", "-e", default="neutral", help="Emotion preset")
14
+ parser.add_argument("--accent", "-a", default="in", choices=["in", "us"], help="Accent")
15
+ parser.add_argument("--output", "-o", default="output.wav", help="Output file path")
16
+ parser.add_argument("--play", "-p", action="store_true", help="Play audio after synthesis")
17
+ args = parser.parse_args()
18
+
19
+ try:
20
+ emotion = Emotion(args.emotion.lower())
21
+ except ValueError:
22
+ print(f"Unknown emotion: {args.emotion}. Using neutral.")
23
+ emotion = Emotion.NEUTRAL
24
+
25
+ engine = SonifyEngine()
26
+ result = engine.synthesize(args.text, emotion=emotion, accent=args.accent, output_path=args.output)
27
+ print(f"Saved to {args.output} ({result.duration:.2f}s)")
28
+
29
+ if args.play:
30
+ try:
31
+ import sounddevice as sd
32
+ sd.play(result.audio, result.sample_rate)
33
+ sd.wait()
34
+ except ImportError:
35
+ print("Install sounddevice to play audio: pip install sounddevice")
36
+
37
+
38
+ if __name__ == "__main__":
39
+ main()