# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['audio_program_generator']

package_data = \
{'': ['*']}

install_requires = \
['alive-progress>=2.1.0,<3.0.0',
 'gTTS>=2.2.2,<3.0.0',
 'pydub>=0.25.1,<0.26.0',
 'single-source>=0.2.0,<0.3.0',
 'typer>=0.4.0,<0.5.0']

entry_points = \
{'console_scripts': ['apg = audio_program_generator.__main__:cli']}

setup_kwargs = {
    'name': 'audio-program-generator',
    'version': '1.10.1',
    'description': 'Create an audio program from a text file containing English sentences',
    'long_description': '\n[![Python package](https://github.com/jeffwright13/audio_program_generator/actions/workflows/python-package.yml/badge.svg)](https://github.com/jeffwright13/audio_program_generator/actions/workflows/python-package.yml)\n[![CodeQL](https://github.com/jeffwright13/audio_program_generator/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/jeffwright13/audio_program_generator/actions/workflows/codeql-analysis.yml)\n\n# apg (audio_program_generator)\nGenerates an audio program from text, with option to mix in background sound\n\nPossible use cases:\n- make your own yoga or qi gong routine\n- play a list of daily affirmations\n- meditate to a mantra with drone music in the background\n- create an audio book\n- read a kid a bedtime story without actually having to do the reading\n\n# Basic Usage\n#### (see \'Detailed Usage\' below for more info)\n```\nUsage: apg [OPTIONS] PHRASE_PATH [SOUND_PATH]\n\nArguments:\n  PHRASE_PATH   Absolute or relative path to phrase file.  [required]\n  [SOUND_PATH]  Path to .wav file to mix with generated speech. [optional]\n\nOptions:\n  -o, --output-path PATH          Path to store resulting audio file.\n  -f, --format, --output-format [wav|mp3|ogg|aac|flac]\n                                  File format for output file.  [default: wav]\n  -a, --attenuation INTEGER       Set background file attenuation in dB.\n                                  [default: 0]\n  -s, --slow                      Generate speech at half-speed.\n  -r, --region [AU|CA|IE|IN|UK|US|ZA]\n                                  Regional accent to apply to generated\n                                  speech.  [default: US]\n  -b, --book-mode                 Operates on plain-text file without\n                                  phrase/pause formatting.\n  -H, --hide-progress-bar         Do not display progress bar during\n                                  execution.\n  -v, --version                   Show version and exit.\n  --install-completion [bash|zsh|fish|powershell|pwsh]\n                                  Install completion for the specified shell.\n  --show-completion [bash|zsh|fish|powershell|pwsh]\n                                  Show completion for the specified shell, to\n                                  copy it or customize the installation.\n  -h, --help                      Show this message and exit.\n```\n\n# Prerequisites\nEither:\n * Python (3.7+)\n * [pip](https://pypi.org/project/pip/) (option 1)\n * [git](https://git-scm.com/) + [poetry](https://python-poetry.org/) (option 2)\n * Local installation of [ffmpeg](https://www.ffmpeg.org/) (to save results in formats other than .wav)\n\nOr:\n * [docker](https://www.docker.com/)\n\n# Installation & Execution\n## With `pip`:\n- Create a virtual environment and activate it:\n    - `python -m venv venv`\n    - `source ./venv/bin/activate`\n - Install the package:\n    - `pip install audio-program-generator`\n- Once this is done, you will have an "apg" executable available in your terminal. You can type `apg` for basic help, or `apg --help` for full instructions.\n- Deactivate your virtual environment when finished:\n    - `deactivate`\n\n## With `poetry`:\n- Clone the repo and cd into the directory:\n    - `git clone https://github.com/jeffwright13/audio_program_generator.git`\n    - `cd audio_program_generator`\n- Install the dependencies using poetry, and activate the virtual environment:\n    - `poetry install --no-dev`\n    - `poetry shell`\n- Once this is done, you will have an "apg" executable available in your terminal. You can type `apg` for basic help, or `apg --help` for full instructions.\n- Exit the poetry virtual environment when finished:\n    - `exit`\n\n## With `docker`:\n- Clone the repo and cd into the directory:\n    - `git clone https://github.com/jeffwright13/audio_program_generator.git`\n    - `cd audio_program_generator`\n- Execute `make apg-build` (builds Docker image)\n- Place your <phrase_file> and any <sound_file> in the `apgfiles` subdirectory; docker will be looking for them there\n- Execute `make apg args=<args>` (runs container with specified arguments; if using multiple arguments, wrap them all in quotes)\n- Results from `make apg` will be available locally in the `/apgfiles` folder, even after the container is stopped\n- Examples:\n    - `make apg args=--help`\n    - `make apg args=-V`\n    - `make apg args="apgfiles/program.txt apgfiles/river.wav -a 0 -t co.in"`\n    - `make apg args="apgfiles/program.txt -slow -t co.in"`\n\n## With `flask`:\n- There is a [sister project](https://github.com/jeffwright13/apg_flask) that wraps the apg module in a bare-bones Flask app. This can be hosted locally, or in a cloud provider such as Heroku, Digital Ocean, or AWS. This method is considered experimental at the moment, and is not officially supported.\n\n# Detailed Usage\n*Assumes you are using the provided `apg` command line interface, installed with one of the methods above.  Refer to the source code if you are importing this code as a module/package.*\n\nPopulate a semicolon-separated text file with plain-text phrases, each followed by an inter-phrase duration (see example below). Each line of the file is comprised of:\n   - a phrase to be spoken (in English)\n   - a semicolon\n   - a silence duration (in seconds)\nProvide a sound file for background sound (optional)\nExecute the command: `apg [options] <phrase_file> [sound_file]`\n\nThe script will generate and save a single audio file. The base name of the file will be the same as the specified input file. The output file will be saved to the same folder that the input text file was taken from, unless specified otherwise (using the "-o" option). For example, if the script is given input file "phrases.txt", the output file will be "phrases.wav" or "phrases.mp3"  or whatever the output format is set to be (using the "-f" option, which defults to ".wav").\n\nThe optional `[sound_file]` parameter, when specified, is used to mix in background sounds/music. This parameter specifies the path/filename of the sound file to be mixed in with the speech generated from the phrase file. If the sound file is shorter in duration than the generated speech file, it will be looped. If it is longer, it will be truncated. The resulting background sound (looped or not) will be faded in and out to ensure a smooth transition (6 seconds at beginning and en). Currently, only .wav files are supported as inputs.\n\nThe CLI prints out a progress bar by default. The progress bar may be disabled with the `--no-progress-bar` option.\n\nThe `--attenuation` option allows fine-tuning the background sound level so it doesn\'t drown out the generated speech.\n\nThe `--slow` option generates each speech snippet is a slow-spoken style.\n\nThe `--tld` option allows the user to select one of several regional \'accents\' (English only). For accents, select one from the following list: ["com.au", "co.uk", "com", "ca", "co.in", "ie", "co.za"]\n\nSpecifying option `--book-mode` creates a spoken-word program (with or without background soundfile). It does this by reading in a file that does not have inter-phrase durations inserted, as is normally the case. This feature is new and needs some tweaking. For now, just make sure your input file is pure text, and experiement with using a single line (with many sentences) as one paragraph vs. multiple lines, one per sentence. You wil notice a difference in how the \'speaker\' pauses between phrases.\n\n# Example `<phrase_file>` file format:\n    Phrase One;2\n    Phrase Two;5\n    Phrase Three;0\n\n# Example `--book-mode` file format:\n    Here we have sentence number one (which is a lovely sentence, and deserves its own paragraph).\n\n    Here is a second paragraph, and this is sentence number one (again) in that paragraph. And this is sentence number two! Then shalt thou count to three - no more, no less. Three shall be the number thou shalt count, and the number of the counting shall be three. Four shalt thou not count, neither count thou two, excepting that thou then proceed to three. Five is right out. Once the number three, being the third number, be reached, then lobbest thou thy Holy Hand Grenade of Antioch towards thy foe, who, being naughty in my sight, shall snuff it.\n\n# Testing\nTests are implemented in pytest. You don\'t really need to worry about that if all you want to do it run them, but chances are if you want to run them, you\'re probably some sort of a hacker or coder or programmer, and you want to know the deets. See the [source code](https://github.com/jeffwright13/audio_program_generator/tree/main/tests) for more info.\n\nTo execute the tests, do one of the following:\n* Fire up your venv (see Installation & Execution section above), cd into the top level of the repo, and type `pytest`.\n\n* Do basically the same thing with poetry:\n\n    `poetry shell`\n\n    `pytest`\n\n* Use docker:\n\n    `make apg-build-test`\n\n    `make test`\n\n# Author:\nJeff Wright <jeff.washcloth@gmail.com>\n\n# Collaborators:\n- Bob Belderbos\n- Erik OShaughnessy\n',
    'author': 'Jeff Wright',
    'author_email': 'jeff.washcloth@gmail.com',
    'maintainer': None,
    'maintainer_email': None,
    'url': 'https://github.com/jeffwright13/audio_program_generator/',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'entry_points': entry_points,
    'python_requires': '>=3.7,<4.0',
}


setup(**setup_kwargs)
