No project description provided
Project description
Audio Library
This is a Python library for audio interface, including text-to-speech (TTS), speech-to-text (STT), audio playback, recording, and processing. It can be used in desktop apps, web apps, and provides a simple API for integration.
Features
- Text-to-speech conversion
- Speech-to-text conversion
- Audio playback
- Audio recording
- Audio processing
Installation
- Clone the repository:
git clone https://github.com/yourusername/audio-library.git
cd audio-library
- Build and run the Docker container:
docker-compose up --build
This will build the Docker image, install all dependencies (including PortAudio), and run the unit tests.
Usage
Here's an example of how to use the various features of the library:
from vocochat.audio.audio import AudioInterface
audio = AudioInterface()
# Text-to-speech example
text = "Hello, this is a test of the text-to-speech functionality."
audio_data = audio.text_to_speech(text)
audio.play_audio(audio_data)
# Speech-to-text example
print("Speak now...")
audio_data = audio.record_audio(duration=5)
text = audio.speech_to_text(audio_data)
print(f"You said: {text}")
# Audio processing example
processed_audio_data = audio.process_audio(audio_data)
audio.play_audio(processed_audio_data)
See the examples directory for more detailed usage examples.
API
AudioInterface
The main interface for the audio library.
text_to_speech(text)
Convert text to speech.
speech_to_text(audio_data)
Convert speech to text.
play_audio(audio_data)
Play audio data.
record_audio(duration)
Record audio from the microphone for the specified duration (in seconds).
process_audio(audio_data)
docker compose up --build
pip install pyaudio
sudo dnf install portaudio-devel redhat-rpm-config
pip install --user pyaudio
Process audio data (e.g., noise reduction, format conversion, etc.).
Contributing
Contributions are welcome! Please see the CONTRIBUTING.md file for guidelines.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vocochat-0.1.2.tar.gz.
File metadata
- Download URL: vocochat-0.1.2.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3231c192d753f232cbc11402d7f877059e2ccc81fef2a300fcabf0cbc23742a
|
|
| MD5 |
161a84b85e35fd28e8c1eaf34dea19ad
|
|
| BLAKE2b-256 |
e86e270b2e14ba1d1889d0d9a1d7e2121ebba6efbf2165fc3353ddeb384b94ab
|
File details
Details for the file vocochat-0.1.2-py3-none-any.whl.
File metadata
- Download URL: vocochat-0.1.2-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e70f592e511b21b10b069f1ccb076a2fadb64fd2cea525593b3f2c208f59638
|
|
| MD5 |
a404a1b5d1c6f2b191e04d47d027073a
|
|
| BLAKE2b-256 |
8e92a678462d6b3e46751d31aed195a5582e76d5a2b3a6482a8a6e4ca7faed11
|