Skip to main content

Bangla Speech-to-Text & Text-to-Speech 🎙️🔊

This project enables Bangla Speech-to-Text (STT) and Text-to-Speech (TTS) conversion. It utilizes advanced AI models to achieve accurate transcription and natural-sounding speech synthesis.

✨ Technologies Used:

  • 🗣️ Speech-to-Text (STT): hishab/titu_stt_bn_fastconformer – A powerful ASR model optimized for Bangla.
  • 🔊 Text-to-Speech (TTS): gTTS – A Google Text-to-Speech library for generating natural Bangla speech.

Setup

pip install -q git+https://github.com/HSAkash/Bangla-Speech2Text2Speech.git

or

pip install bnsttts

How to use in code

Speech to text

from bnsttts.stt import STT
stt = STT()
response = stt.transcribe("data/stt/01.wav")
print(response[0])

Text to speech

from bnsttts.tts import TTS
tts = TTS()
tts.speak("আমি বাংলায় কথা বলতে পারি", "data/tts/output.mp3", lang="bn")

Run commands

Speech to text

bnsttts -s <audio_file_path>

Example

🎵 Listen to the sample audio: Click here

bnsttts --stt data/stt/01.wav
output:
শুন কে আমি শিশু সুলভ বোক আমি মিশ্রণ হিসেবে বর্ণ না করব তিনি প্রায়ই সময় ডিমেরে এক হাজার ডলার খরচ করতেন তিনি তার বন্ধুদের সামনে সম্পথের শো অফ করতেন তিনি প্রকাশ্যে এবং উচ্চ সরে তার সম্পদ নিয়ে বড়াই করতেন প্রায় সময় মাতাল অবস্থায় এই হোটেল থেকে বের হতেন একদিন তিনি আমার এক সহকর্মীর হাতে নগদ কয়েক হাজার ডলার দিয়ে বললেন রাস্তার পাশে গয়নার দোকানে যাও এবং আমার জন্য কয়েক ডলার মূল্যের এক হাজার একটি সোনার কয়েন কিনে আন এক ঘন্টা পর হাতে সোনার কয়েন নিয়ে প্রকৌশলী এবং তার বন্ধুরা প্রশান্ত

Text to Speech

bnsttts -t <text>

Example

bnsttts --tts "আমি বাংলায় কথা বলতে পারি" -o data/tts/output.mp3
output:

🎵 Listen to the sample output: Click here

Audio file saved at data/tts/output.mp3

Help command

bnsttts -h
Usage: bnsttts [OPTIONS] CONTENT

  A CLI tool to convert text to speech or speech to text.

  Args:
    content (str): audio file path or text
    output (str): Where text to audio file will be stored.
    lang (str): Language to speak in (e.g., en, bn)
    tts (bool): For text to speech.
    stt (bool): For speech to text.
    slow (bool): For slow speech.

  Returns:
    str: Path to the generated audio file or transcribe text.

Options:
  -o, --output TEXT  Where text to audio file will be stored.
  -l, --lang TEXT    Language to speak in (e.g., en, bn
  -t, --tts          For text to speech.
  -s, --stt          For speech to text.
  --slow             For slow speech.
  -h, --help         Show this message and exit.

Metadata

Release files for Bangla-Speech2Text2Speech 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Bangla-Speech2Text2Speech 0.0.1
File Size Uploaded Provenance Actions
bangla_speech2text2speech-0.0.1.tar.gz 12.3 kB Without provenance Details for bangla_speech2text2speech-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for Bangla-Speech2Text2Speech 0.0.1
File Interpreter ABI Platform Actions
Bangla_Speech2Text2Speech-0.0.1-py3-none-any.whl Python 3 none any Details for Bangla_Speech2Text2Speech-0.0.1-py3-none-any.whl

Total release size: 26.5 kB

Release files / bangla_speech2text2speech-0.0.1.tar.gz

Download URL bangla_speech2text2speech-0.0.1.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1e0c430c8c9c9001dc7f33d0be74db0c2d59f3a611cfed6a6aa8d78196982185
BLAKE2b-256 checksum
How to use checksums
49b9baa4f198372d0996a54b337fbbfc05398fc928d5192a0c29ec33b9d6e157
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release files / Bangla_Speech2Text2Speech-0.0.1-py3-none-any.whl

Download URL Bangla_Speech2Text2Speech-0.0.1-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0817d94cae9239d44c6d832ea5afcdc5e6e5241f9ce1df1f42d0294afb23bda4
BLAKE2b-256 checksum
How to use checksums
a94e379b0b11e8d591365b64fadee873355ed7611f9226fc3d44351dc7401613
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Security for Bangla-Speech2Text2Speech 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page