Top 8 Libraries For Audio Processing In Python
7:33

Top 8 Libraries For Audio Processing In Python

AssemblyAI 15.05.2022 82 354 просмотров 1 230 лайков

Machine-readable: Markdown · JSON API · Site index

Поделиться Telegram VK Бот
Транскрипт Скачать .md
Анализ с AI
Описание видео
In this Tutorial we show you the Top 8 Audio Processing libraries in Python. Get your Free Token for AssemblyAI Speech-To-Text API 👇https://www.assemblyai.com/?utm_source=youtube&utm_medium=referral&utm_campaign=yt_pat_36 Torchaudio tutorial: https://youtu.be/3mju52xBFK8 - IPython.display - SoundFile - wave module Python - PyAudio - SoundDevice - PyDub - Librosa - Torchaudio ▬▬▬▬▬▬▬▬▬▬▬▬ CONNECT ▬▬▬▬▬▬▬▬▬▬▬▬ 🖥️ Website: https://www.assemblyai.com 🐦 Twitter: https://twitter.com/AssemblyAI 🦾 Discord: https://discord.gg/Cd8MyVJAXd ▶️ Subscribe: https://www.youtube.com/c/AssemblyAI?sub_confirmation=1 🔥 We're hiring! Check our open roles: https://www.assemblyai.com/careers ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ Audio- Icon by Eucalyp - Flaticon: https://www.flaticon.com/de/kostenlose-icons/audio #Python

Оглавление (8 сегментов)

<Untitled Chapter 1>

hi everyone today i show you eight extremely useful python libraries for audio processing so let's get started right away the first one is for displaying and

Displaying and Playing Audio Files

playing audio files and for this we can use ipython display so we import audio and display and then say display audio and then a file name so here i have two wav files that i prepared already and now i can simply execute this and this is especially useful in an interactive notebook like here in this google co-op and now here we can display this and also play the sound

Sound Files

the second one is called sound files so this can be used for simply reading and writing different formats like wave flag and then these ones you can install it with pip install sound file then we can import it and then we can for example read a wav file and this will get us a numpy array and the sample rate so we can print data. shape and then we can also very simply say soundfile. right and use a different format here and if we run this and then have a look at the directory again then here we see we have the new file

Wave Module

the next one is the wave module this is actually a built-in module so we don't have to install anything here and this also allows us to open wav files and then also write new wav files and the interface is a little bit more complicated than with sound file but also not too hard so we can simply say wave open in read mode and then we can access different parameters like the number of channels the sample width the frame rate the number of frames then here we read the frames and the same way we can dump all the files so now we open it in write mode and then we can set all the parameters again and then say object dot right frames with the frames and close it again so also pretty straightforward

Pi Audio

the next one is pi audio which offers python bindings for port audio which is a popular cross-platform audio io library so again this can be used to read and write audio files but also to read the microphone input so for this depending on your operating system you might have to install a few extra libraries for port audio then you can say pip install pi audio and then in this example script i show you how we can read the microphone input so for this we import pi audio then we set up different parameters then we create a pi audio instance and then we say p open with all the parameters to get a stream and then we can read the stream so here we read the microphone input by saying stream. read this will read it in different chunks and then we can append the different chunks to a frames to a list of different frames then we close the stream again and then we can use the frames to work with this for example here we use the wave module again and then say wav file dot right frames and dump all the frames again to a wav file another alternative to read the

Sound Device

microphone input is sound device this also gives you bindings for port audio and has a few convenience functions to record and play the audio so this is a little bit simpler to use than pi audio but it also gives you less control on a lower level so we can also install it with pip install sound device then we import it and this is how easily we record the microphone input so we simply say sound device record with the duration the sample rate the number of channels and other parameters then we can say sound device wait and then we have it and then we can simply say sound device play and play the recording again and yeah that's how easily we can do it with sound device next we have pi dub with this we can

Pi Dub

manipulate audio with a simple and easy high level interface and with this we can also work with other file formats for example if we need a mp3 file so we can also install it by saying pip install pi dub then we can for example import the audio segment then we can read the wav file by saying from wave and this also works with other formats like for example from mp3 and this is how easily we can manipulate the data for example we can boost the volume like this we can repeat the clip by simply multiplying it we can do things like fade in or fade out then we can export it again and specify a different format and yeah this is how to work with pied up next we have flip rosa this is the most popular library for music and audio analysis so if you need to do any kind of analysis there's probably no way around librosa we can also install it with pip and then we can easily load the data this will give us a one-dimensional numpy array so now we can work with this and also the sample rate then it has built-in functions to easily plot the data so here we say this play wave plot and then here we have the wave plot we can also do other kinds of plots for example we can say display dot spec show and plot this back to gram and then it has um all kinds of feature analysis functions for example in this little example code i extract the spectral centroid and plot this so it has a lot of different functions to do audio analysis and for this i just recommend to check out the documentation and the last library i want to show you

Torch Audio

is torch audio this is probably the king of all audio processing libraries so with this you can do all kinds of audio and signal processing and it's built on top of pi torch it provides io signal and data processing functions data sets model implementations and application components so a lot of functionality it probably takes a little bit of time to learn it but we have a whole tutorial on our channel that walks you through all the different basics and i will link it here and below the video so we can also very easily load a wav file then we get the waveform and this is a pi torch tensor then again we get the sample rate then we can easily do resampling by using the torch audio functional functions and then we can apply f dot resample then here we can also apply a different low pass filter with or a different resampling method if you're familiar with this then you can apply different effects to the audio file for example here we change the speed and again apply a low pass filter and we can apply reverberation to give a dramatic feeling so again i will walk you through this in the other uh tutorial that i will link here and yeah this is how to use the torch audio library alright and these are in my opinion the most important libraries in python for audio processing if i missed any library then let us know in the comments and if you want to see more in detail tutorials about any of these libraries then also let us know in the comments and subscribe to our channel for more content and then i hope to see you in the next video bye

Другие видео автора — AssemblyAI

Ctrl+V

Экстракт Знаний в Telegram

Экстракты и дистилляты из лучших YouTube-каналов — сразу после публикации.

Подписаться

Дайджест Экстрактов

Лучшие методички за неделю — каждый понедельник