Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
tts-stt-tools
is a Python package designed to facilitate seamless Text-to-Speech (TTS) and Speech-to-Text (STT) conversions. With customizable voice models and simple commands, it offers an easy way to convert text into audio and manage audio-to-text transcriptions.
.wav
or .log
for processing and cleanup.Follow these steps to install the tts-stt-tools
package and its dependencies:
python3 -m venv testEnv1
source testEnv1/bin/activate
Inside the virtual environment, install the package:
pip install --editable .
The following sections demonstrate how to use both TTS and STT functionalities, including specifying models and handling output files.
Convert text to speech and save it as an audio file using different voice models.
from tts_stt_tools import process_text_to_speech
text = """
Part three
November 10–Present
CHAPTER 14
• Monday, November 10
On Monday morning, Maxine is startled...
"""
process_text_to_speech(text, voice_model='en_US/hifi-tts_low', filename='output1.wav')
process_text_to_speech(text, voice_model='en_US/cmu-arctic_low', filename='output2.wav')
process_text_to_speech(text, voice_model='en_US/ljspeech_low', filename='output3.wav')
process_text_to_speech(text, voice_model='en_US/m-ailabs_low', filename='output4.wav')
process_text_to_speech(text, voice_model='en_US/vctk_low', filename='output5.wav')
process_text_to_speech(text, voice_model='en_UK/apope_low', filename='output6.wav')
Convert a .wav
audio file into text using the specified STT model.
from tts_stt_tools import process_speech_to_text
mp3_path = "output1.wav"
output_directory = "" # Optional: specify if needed
model_path = "vosk-model-small-en-us-0.15"
result = process_speech_to_text(mp3_path, output_directory, model_path)
print(result)
Unit tests are included to ensure the correct behavior of TTS and STT processes. The tests create .wav
files for various voice models, verifying that the output files exist after processing.
.wav
files and temporary directories are removed after testing.To run the tests, simply use:
pytest
The tests will:
To clean up resources such as temporary files and directories after the tests, use:
deactivate
rm -r testEnv1
rm -r *.log *.wav
rm -r vosk-model-*
This updated documentation reflects the test cases and ensures users have a clear understanding of the TTS-STT workflow with examples.
FAQs
A package for text-to-speech and speech-to-text tools
We found that tts-stt-tools 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.