- [Instructor] Finally the last piece of this example
is our play audio function, which again, we called twice,
once to play the English audio that was created
from originally Spanish spoken audio that we transcribed
to Spanish, translated to English and then played
back the English and then separately we had one
in the other direction where we took the English audio,
transcribed it to English text, translated it to Spanish
text and then got back Spanish audio.
In both cases we loaded an audio file from disk
and played it back with this function.
And to to do that we took advantage of the pydub module
and the pydub module has an Audio Segment class
that enables you to load up an audio file
from a specified file name and you can do that in a variety
of formats, one of which is the wav file format,
which is what we've been using in this application.
So as a result of this line of code, we will have an object
loaded into our Python application that represents
a wav audio file and in the pydub module's playback
sub module we have a play function,
you simply hand it the audio segment object
and it will play the sound.