Skip to main content

A package to retrieve available voices from Azure Cognitive Services Speech SDK.

Project description

Azure Voice List

azure_voice_list is a Python package that integrates with Azure Cognitive Services Speech SDK to retrieve available voices.

Features

  • Retrieve available voices from Azure Speech SDK
  • Save voice attributes to a text file
  • Execute as a command-line tool for quick access
  • Use as a standalone Python script within your projects

Installation

You can install azure_voice_list via PyPI using pip:

pip install azure_voice_list

Usage

1. Importing and Using in Python Scripts

You can easily integrate azure_voice_list into your Python projects by importing the necessary functions.

from azure_voice_list import get_available_voices

# Set your Azure credentials
speech_key = "YOUR_AZURE_SPEECH_KEY"
service_region = "YOUR_AZURE_SERVICE_REGION"

voices = get_available_voices(speech_key, service_region)
if voices:
    for voice in voices:
        print(voice)

2. Executing as a Command-Line Tool

Running azure_voice_list as a command-line tool allows you to retrieve and save voice attributes without writing additional Python code.

a. Install the Package

You can install azure_voice_list via PyPI using pip:

pip install azure_voice_list

b. Run the Command-Line Tool

Once installed, you can execute the tool from your terminal:

azure-voice-list

Example Output:

Voice attributes have been saved to 'output/voice_attributes_20230927_123456.txt'

c. Provide Azure Credentials

The command-line tool relies on environment variables for Azure credentials. Ensure you have a .env file in your project's root directory with the following content:

AZURE_SPEECH_KEY=your_azure_speech_key
AZURE_SPEECH_REGION=your_azure_service_region

Alternatively, you can set these environment variables in your system.

3. Executing as a Standalone Python Script

If you prefer to run azure_voice_list without installing it as a package, you can execute the script directly using Python.

a. Clone the Repository

First, clone the repository to your local machine:

git clone https://github.com/BlueBirdBack/azure_voice_list.git
cd azure_voice_list

b. Install the Package

Install the package and its dependencies using pip:

pip install .

c. Run the Script

Execute the main.py script using Python:

azure-voice-list

Example Output:

Voice attributes have been saved to 'output/voice_attributes_20230927_123456.txt'

d. Provide Azure Credentials

Similar to the command-line tool, ensure that the .env file with your Azure credentials is present in the project root directory:

AZURE_SPEECH_KEY=your_azure_speech_key
AZURE_SPEECH_REGION=your_azure_service_region

Alternatively, set the environment variables in your system.

Output Directory

By default, the azure_voice_list tool saves the voice attributes to an output directory located at the root of the project. If you encounter multiple output directories, ensure you're running the tool from the project root and verify the configuration in the script.

License

MIT

Additional Information

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

azure_voice_list-0.1.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

azure_voice_list-0.1.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file azure_voice_list-0.1.0.tar.gz.

File metadata

  • Download URL: azure_voice_list-0.1.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for azure_voice_list-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6ed684e9beaed2f59e97392d719b77f9ef9bbc7053d39ac9f62b7c14599be804
MD5 55b419d0d4015bcf992ca12987bd43e0
BLAKE2b-256 aec9a8fa7a78ae6dbd2af5ce5da3437648310b1c01d622d0d27e47ea06cb5841

See more details on using hashes here.

File details

Details for the file azure_voice_list-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for azure_voice_list-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 94d4b9838b2e2ef3dd16f1150c6f2d4c619b33bf5c330c1a7fc1a00cf4b91a23
MD5 eece5d97dcd82c0cbf124e42ea4cd243
BLAKE2b-256 d587c6767098952a7cf6df476f870dd03ea3ac65273d39c1bc0edaaeda85ee12

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page