
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
BanglaSpeech2Text: An open-source offline speech-to-text package for Bangla language. Fine-tuned on the latest whisper speech to text model for optimal performance. Transcribe speech to text, convert voice to text and perform speech recognition in python with ease, even without internet connection.
Model | Size | Best(WER) |
---|---|---|
tiny | 100-200 MB | 74 |
base | 200-300 MB | 46 |
small | 1 GB | 18 |
large | 3-4 GB | 11 |
NOTE: Bigger model have better accuracy but slower inference speed. More models HuggingFace Model Hub
You can install the library using pip:
pip install banglaspeech2text
To use the library, you need to initialize the Speech2Text class with the desired model. By default, it uses the "base" model, but you can choose from different pre-trained models: "tiny", "small", "base", or "large". Here's an example:
from banglaspeech2text import Speech2Text
stt = Speech2Text("base")
# You can use it wihout specifying model name (default model is "large")
stt = Speech2Text()
You can transcribe an audio file by calling the recognize
method and passing the path to the audio file. It will return the transcribed text as a string. Here's an example:
transcription = stt.recognize("audio.wav")
print(transcription)
segments = stt.recognize("audio.wav", return_segments=True)
for segment in segments:
print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))
BanglaSpeech2Text supports the following audio formats for input:
No need for extra code to convert audio files to a specific format. BanglaSpeech2Text automatically handles the conversion for you:
transcription = stt.recognize("audio.mp3")
print(transcription)
You can use SpeechRecognition package to get audio from microphone and transcribe it. Here's an example:
import speech_recognition as sr
from banglaspeech2text import Speech2Text
stt = Speech2Text()
r = sr.Recognizer()
with sr.Microphone() as source:
print("Say something!")
r.adjust_for_ambient_noise(source)
audio = r.listen(source)
output = stt.recognize(audio)
print(output)
You can instantly check the model with gradio. Here's an example:
from banglaspeech2text import Speech2Text, available_models
import gradio as gr
stt = Speech2Text()
# You can also open the url and check it in mobile
gr.Interface(
fn=stt.recognize,
inputs=gr.Audio(source="microphone", type="filepath"),
outputs="text").launch(share=True)
stt = Speech2Text("openai/whisper-tiny")
stt = Speech2Text("base")
print(stt.model_metadata) # Model metadata (name, size, wer, license, etc.)
print(stt.model_metadata.wer) # Word Error Rate (not available for all models)
You can use the library from the command line. Here's an example:
bnstt 'file.wav'
You can also use it with microphone:
bnstt --mic
Other options:
usage: bnstt
[-h]
[-gpu]
[-c CACHE]
[-o OUTPUT]
[-m MODEL]
[-s]
[-sm MIN_SILENCE_LENGTH]
[-st SILENCE_THRESH]
[-sp PADDING]
[--list]
[--info]
[INPUT ...]
Bangla Speech to Text
positional arguments:
INPUT
inputfile(s) or list of files
options:
-h, --help
show this help message and exit
-o OUTPUT, --output OUTPUT
output directory
-m MODEL, --model MODEL
model name
--list list of available models
--info show model info
If your business or project has specific speech-to-text requirements that go beyond the capabilities of the provided open-source package, I'm here to help! I understand that each use case is unique, and I'm open to collaborating on custom solutions that meet your needs. Whether you have longer audio files that need accurate transcription, require model fine-tuning, or need assistance in implementing the package effectively, I'm available for support.
FAQs
An open-source offline speech-to-text package for Bangla language.
We found that BanglaSpeech2Text demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.