
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
google-speech-pyplay
Advanced tools
Text-to-speech synthesis using the Google Translate TTS API and pygame.
A lightweight fork of the google_speech
library, that replaces sox
with pygame
and removes sound effects for a lightweight and straightforward implementation.
Table of Contents
pip install google_speech_pyplay
The library provides both a Command-Line Interface (CLI) and an API for programmatic use.
You can use the google_speech_pyplay
command directly from the terminal:
python -m google_speech_pyplay "Hello, world!" -l en
Options:
-l
, --lang
: Specify the language (e.g., en
for English, es
for Spanish).-o
, --output
: Save the speech output to an MP3 file instead of playing it.Save the text-to-speech output to output.mp3
:
python -m google_speech_pyplay "Hello, world!" -l en -o output.mp3
Here are some examples of how to use the library in Python scripts.
from google_speech_pyplay import Speech
# Specify the text and language
text = "Hello, world!"
language = "en"
# Create a Speech object and play the text
speech = Speech(text, language)
speech.play()
from google_speech_pyplay import Speech
# Specify the text and language
text = "Hola, mundo!"
language = "es"
# Create a Speech object and save the speech to an MP3 file
speech = Speech(text, language)
speech.save("output.mp3")
To set up a fresh development environment for the google_speech_pyplay
project, follow these steps:
pip
(comes bundled with Python) and upgrade it to the latest version:
python3 -m pip install --upgrade pip
Clone the repository:
git clone https://github.com/KarimAziev/google_speech_pyplay.git
cd google_speech_pyplay
Create and activate a virtual environment:
python3 -m venv .venv
source .venv/bin/activate # For Linux/Mac
# or
.venv\Scripts\activate # On Windows
Upgrade core tools inside the virtual environment:
pip install --upgrade pip setuptools wheel
Install the project in editable (development) mode with all dependencies:
pip install -e ".[dev]" # Includes dev dependencies like black, pre-commit, isort
To build the project for distribution, e.g., creating .tar.gz
and .whl
files:
Install the build tool:
pip install build
Build the distribution:
python -m build
This will generate a dist/
directory containing the following artifacts:
google_speech_pyplay-x.y.z.tar.gz
)google_speech_pyplay-x.y.z-py3-none-any.whl
)You can install these locally for testing or upload them to PyPI for publishing.
rm -rf build dist *.egg-info
deactivate
setuptools_scm
to handle versioning, based on the Git tags of the repository. Ensure you use proper semver tags like v1.0.0
to manage versions correctly.black
, isort
) are automatically installed when running pip install -e ".[dev]"
.FAQs
Text-to-speech synthesis using the Google Translate TTS API and pygame.
We found that google-speech-pyplay 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
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.