emon 🎙️🔊
emon is a simple Python package that gives your projects a voice — both speaking and listening — with just a few lines of code.
✨ Features
| Feature | Description |
|---|---|
v.say(text) |
Speak any text out loud (Text-to-Speech via gTTS) |
v.listen(prompt) |
Listen through microphone → return text (Speech-to-Text via Google) |
v.conversation(handler) |
Run a full voice-to-voice loop with your own logic |
| Multi-language | Works with Bangla, French, Spanish, and 50+ languages |
📦 Installation
pip install emon
Windows note: If
PyAudiofails to install, run:pip install pipwin pipwin install pyaudioLinux note:
sudo apt-get install portaudio19-dev python3-pyaudio pip install pyaudio
🚀 Quick Start
from emon import voice as v
# Speak something
v.say("Hello! I am emon, your voice assistant.")
# Listen for a reply
user = v.listen("Say something...")
print("You said:", user)
# Respond based on input
if "how are you" in user.lower():
v.say("I am fine, thank you!")
🔄 Voice-to-Voice Conversation
Build a full voice chatbot in minutes:
from emon import voice as v
def my_bot(text):
text = text.lower()
if "hello" in text:
return "Hello! How can I help you?"
elif "how are you" in text:
return "I am fine and you?"
elif "your name" in text:
return "My name is Emon Assistant."
else:
return f"You said: {text}. I am still learning!"
# Starts listening in a loop. Say 'goodbye' to stop.
v.conversation(my_bot)
🌍 Multi-Language Support
from emon import voice as v
# Bangla
v.say("আমি ভালো আছি", lang="bn")
# French
v.say("Bonjour le monde", lang="fr")
# Listen in Bangla
text = v.listen("বলুন...", language="bn-BD")
📖 API Reference
v.say(text, lang="en", slow=False)
Converts text to speech and plays it through your speakers.
| Parameter | Type | Default | Description |
|---|---|---|---|
text |
str | — | The words to speak |
lang |
str | "en" |
gTTS language code |
slow |
bool | False |
Speak slower if True |
v.listen(prompt="Listening...", timeout=5, phrase_time_limit=10, language="en-US")
Records from your microphone and returns the recognised text as a string.
Returns "" (empty string) if nothing was heard.
| Parameter | Type | Default | Description |
|---|---|---|---|
prompt |
str | "Listening..." |
Console message while waiting |
timeout |
int | 5 |
Seconds to wait for speech to start |
phrase_time_limit |
int | 10 |
Max seconds per phrase |
language |
str | "en-US" |
BCP-47 recognition language |
v.conversation(handler, prompt="Listening...", exit_phrase="goodbye", language="en-US", tts_lang="en")
Runs a continuous voice loop. handler receives the heard text and returns a reply string.
📄 License
MIT © ABS EMON
Metadata
Release files for emon 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| emon-0.0.8.tar.gz | 6.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| emon-0.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.9 kB
Release files / emon-0.0.8.tar.gz
| Download URL | emon-0.0.8.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ed10a96d7008afc8c3781e53ae4f338ab06586e71b4b57c2afcd7981bb23a068
|
|
BLAKE2b-256 checksum How to use checksums |
9ca45338e23dd5b471e768914fa9e000001f88e25deaf5a48d650551b03e4a97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / emon-0.0.8-py3-none-any.whl
| Download URL | emon-0.0.8-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fa2899b902e5dc7e2003bfd427373e1616ea948cd89441f86e832219b368e901
|
|
BLAKE2b-256 checksum How to use checksums |
a42e9a0e2e2d38db59066467dbdc1ee2f3f4f90245c6d52a3a748982a0803ca8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|