1 00:00:00,760 --> 00:00:03,230 - [Instructor] Finally the last piece of this example 2 00:00:03,230 --> 00:00:07,200 is our play audio function, which again, we called twice, 3 00:00:07,200 --> 00:00:12,060 once to play the English audio that was created 4 00:00:12,060 --> 00:00:16,750 from originally Spanish spoken audio that we transcribed 5 00:00:16,750 --> 00:00:19,230 to Spanish, translated to English and then played 6 00:00:19,230 --> 00:00:22,020 back the English and then separately we had one 7 00:00:22,020 --> 00:00:25,210 in the other direction where we took the English audio, 8 00:00:25,210 --> 00:00:28,210 transcribed it to English text, translated it to Spanish 9 00:00:28,210 --> 00:00:30,890 text and then got back Spanish audio. 10 00:00:30,890 --> 00:00:34,340 In both cases we loaded an audio file from disk 11 00:00:34,340 --> 00:00:36,640 and played it back with this function. 12 00:00:36,640 --> 00:00:40,500 And to to do that we took advantage of the pydub module 13 00:00:40,500 --> 00:00:44,220 and the pydub module has an Audio Segment class 14 00:00:44,220 --> 00:00:47,625 that enables you to load up an audio file 15 00:00:47,625 --> 00:00:52,625 from a specified file name and you can do that in a variety 16 00:00:52,780 --> 00:00:57,070 of formats, one of which is the wav file format, 17 00:00:57,070 --> 00:01:00,010 which is what we've been using in this application. 18 00:01:00,010 --> 00:01:03,740 So as a result of this line of code, we will have an object 19 00:01:03,740 --> 00:01:06,850 loaded into our Python application that represents 20 00:01:06,850 --> 00:01:11,350 a wav audio file and in the pydub module's playback 21 00:01:11,350 --> 00:01:13,960 sub module we have a play function, 22 00:01:13,960 --> 00:01:16,950 you simply hand it the audio segment object 23 00:01:16,950 --> 00:01:18,843 and it will play the sound.