Skip to main content

Discover the pinnacle of audio elegance with this simple-player module, boasting a sophisticated blend of advanced features and seamless compatibility across multiple platforms.

Project description

Simple Player

Discover the pinnacle of audio elegance with this simpleplayer module, boasting a sophisticated blend of advanced features and seamless compatibility across multiple platforms.


Installation

You can install the module using pip:

pip install simpleplayer

Terminal Usage

You can also use the module directly from the terminal:

simpleplayer path/to/your/audio/file.wav

Usage

Import the simpleplayer class from the simpleplayer module:

from simpleplayer import simpleplayer

Create an instance of the AudioPlayer class, providing the filename of the audio file as a parameter:

player = simpleplayer('path/to/your/audio/file.wav')

Replace 'path/to/your/audio/file.wav' with the actual path to your audio file.


Play Audio

To start playing the audio, call the play() method:

player.play()

Pause and Resume

You can pause the audio playback by calling the pause() method:

player.pause()

To resume the playback, call the resume() method:

player.resume()

Stop Audio

To stop the audio playback, use the stop() method:

player.stop()

Example

Here's an example that demonstrates the usage of the AudioPlayer module:

from simpleplayer import simpleplayer

# Create an instance of AudioPlayer
player = simpleplayer('path/to/your/audio/file.wav')

# Start playing the audio
player.play()
player.wait()

# Perform actions or wait for the audio to finish

# Pause the audio playback
player.pause()

# Resume the audio playback
player.resume()

# Stop the audio playback
player.stop()

Remember to replace 'path/to/your/audio/file.wav' with the actual path to your audio file.


Simple Player Example



Voice Generator

The voicegen module allows you to convert text to speech and save it as an audio file using the gtts library.

To use the voicegen module, you need to follow these steps:

  1. Import the voicegen class from the voicegen module:

    from simpleplayer import voicegen
    
  2. Create an instance of the voicegen class, providing the text, filename, and an optional language parameter:

    voicegen(text, filename, lang='en')
    

    Replace text with the text you want to convert to speech, filename with the desired name of the output audio file, and lang with the language code (default is 'en').

  3. If the internet connection is available, the text will be converted into speech and saved as an MP3 file with the specified filename.


Example usage:

from simpleplayer import voicegen

# Generate the voice
voicegen("Hello, world!", "output")

This will generate an audio file named output.mp3 containing the speech for the text "Hello, world!".


Terminal Usage

You can also use the voicegen module directly from the terminal:

voicegen "Hello, world!" output

Replace "Hello, world!" with the desired text and output with the desired filename (without the file extension). The generated audio file will be saved as output.mp3 in the current directory.

Note: Ensure that you have a stable internet connection to use the voicegen module successfully.



LICENSE

This project is licensed under the MIT License - see the LICENSE file for details.

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

simpleplayer-0.0.2.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simpleplayer-0.0.2-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file simpleplayer-0.0.2.tar.gz.

File metadata

  • Download URL: simpleplayer-0.0.2.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for simpleplayer-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c1d45a50773e7d9c7352248d440eec200a61311b4a188d7c5da4ea35d33fdbc1
MD5 4fd7156e5e758d5ba53b3ca3be8a4b40
BLAKE2b-256 bff429e9fbaa107e90587d29a7e3db52a5d5431e100fc1cc2e70eca49c78675c

See more details on using hashes here.

File details

Details for the file simpleplayer-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: simpleplayer-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for simpleplayer-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 794ee84a926a6775d8169522ca8bd68241f7b08adb8ad8a1afc963f17b3d2f11
MD5 8d61ccb2c125272865dfcf2f61cd4ca1
BLAKE2b-256 e6d2bb7bcf28e66137c95a8492116e8f377402c9cc8da26d06c0507895ebc7c5

See more details on using hashes here.

Supported by

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