/espydio

A command line utility built using Python that helps playing audio on ESP32.

Primary LanguagePythonOtherNOASSERTION

espydio

A command line utility built using python to automate audio file conversions, thereby assisting audio playing on ESP32 (primarily for Tactile Tricorder).

Installation

  • This requires that SoX version 14.4.2 or higher is installed with required handlers for MP3 files (path for excecutable file must be added to environment variables).

  • To install the most up-to-date release of this module via PyPi:

    pip install espydio

  • To install the master branch:

    pip install git+https://github.com/namanPuri/espydio.git

    or, Simply clone the git repository and install setup.py.

    git clone https://github.com/namanPuri/espydio.git
    cd pysox
    python setup.py install

USAGE

Once espydio is installed, open any command-line tool and run :

    >espydio

If everything is good upto here, this must be recognised and you will get this as output.

usage: espydio [-h] {info,toWav,toHex,tts,stream,allToWav,allToHex,allToMp3,tth} ...
espydio: error: the following arguments are required: command

i.e., Installation test

espydio - List of Commands

  1. info
  2. toWav
  3. toHex
  4. tts
  5. stream
  6. allToWav
  7. allTohex
  8. allToMp3
  9. tth

To get a list of commands, in command-line tool itself with short description, you can run

>espydio -h

espydioHelp

Command Descriptions and Examples

To get the description of using a particular command you can run:

>espydio <name of command> -h

Command Usage

It will output the command usage and decription of it's required parameters.

1. info

Description: This command can be used to print the details of the given audio file.

Usage: espydio info [-h] -n NAME_OF_FILE

Example:

info-usage

2. toWav

Description: This command converts the given MP3 or OGG file to WAV format with a sampling rate of 24khz and with sample encoding as 8-bit unsigned-integer PCM.

Usage: espydio toWav [-h] -i INPUT_FILE_NAME -o OUTPUT_FILE_NAME

Example:

toWav-usage

Comparing the details of MP3 file and converted Wav file.

Comparison

3. toHex

Description: This command converts the given WAV file to arduino-ide supported C header file containing the hex codes of the samples stored in an array with the required type qualifier to store the array in flash memory of the controller and not in RAM.

Usage: usage: espydio toHex [-h] -n WAV_FILE_NAME -a ARRAY_NAME -o HEX_FILE_NAME

Example:

toHex-usage

C header would like this.

C-Header