In this video, we will work with audio processing.
Some of the more common things we do to process audio is to
convert it from one format to other and in the interests of
protecting the ears of our audience,
ensuring that perhaps the loudness levels of different audio files are the same.
We will use the pydub library for the basic conversion and
matchering for level balancing. Using pydub to convert from one
file format to another is the only undertake,
as usual, a few lines of code.
After we declare the file that we're going to convert,
we load this into pydub using the from file method.
The conversion is as simple as calling the export method and flagging the
format we want the audio converted to. Pydub is an extremely powerful audio
tool and it does a lot more than converting files.
From a web media processing point of view, you'll find it's an extremely
useful part of your audio processing tool kit. For level balancing, we
will use the matchering library. As before,
use PIP 3 to install. Matchering uses a single
method to carry out its operation.
We call the main library and the method process and then pass in the target
audio file that you want to match with another file and then enter the
reference file that defines the loudness level.
Finally, you declare the file where you want the finished output sent to.
As with pydub, matchering has a lot more functionality than we
covered and it's worth reviewing in more detail.