Using the encoding server

Finally, the time has come to test this audio encoder! In order to test it easily, some audio recordings are available in the audio-dataset folder of the code files. It is obviously possible to use any other MP3 file. This application is structured as a Python package, so it can be installed with the Python setup tools. From a virtualenv environment, type the following shell command to install the server:

(venv-rx)$ python3 setup.py install

This installs the application package, as well as all its dependencies. When developing an application, it can be annoying to install it many times to test some code changes. In such cases, the setup tool's develop command is useful:

(venv-rx)$ python3 setup.py develop

The develop command creates a symbolic link in the Python packages directory to the current package. This allows us to always use the current code, without having to install the application after each change. The server can now be started:

(venv-rx)$ audio-encode-server --config ./config.sample.json

Curl can be used again to test the application. An encoding request can be done with this command-line, from another shell:

curl -X POST --data-binary @../audio-dataset/banjo1.mp3 http://localhost:8080/api/transcode/v1/flac/banjo1

This should print an ok log when the request completed. The MP3 file encoded in FLAC should be available in the /tmp/banjo1.flac file. Changing the banjo1 name at the end of the URL will encode the audio in another filename.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.179.220