Skip to main content

Voice input and output toolkit — build voice-to-voice projects easily.

Project description

emon 🎙️🔊

emon is a simple Python package that gives your projects a voice — both speaking and listening — with just a few lines of code.

PyPI version Python 3.8+ License: MIT


✨ 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 PyAudio fails to install, run:

pip install pipwin
pipwin install pyaudio

Linux 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

emon-0.0.8.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

emon-0.0.8-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file emon-0.0.8.tar.gz.

File metadata

  • Download URL: emon-0.0.8.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for emon-0.0.8.tar.gz
Algorithm Hash digest
SHA256 ed10a96d7008afc8c3781e53ae4f338ab06586e71b4b57c2afcd7981bb23a068
MD5 00b2829150d6b2df5b7ce783e0164e08
BLAKE2b-256 9ca45338e23dd5b471e768914fa9e000001f88e25deaf5a48d650551b03e4a97

See more details on using hashes here.

File details

Details for the file emon-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: emon-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for emon-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 fa2899b902e5dc7e2003bfd427373e1616ea948cd89441f86e832219b368e901
MD5 f2c720572e27d65043d546cd0b3abef4
BLAKE2b-256 a42e9a0e2e2d38db59066467dbdc1ee2f3f4f90245c6d52a3a748982a0803ca8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page