Thumbnail article
Visualize audio using python into waveplot

Audio can be visualize into a several form. One of the visualization called waveplot. Waveplots visualize the loudness of the audio at a given time. Visualization can be done easily using python library called librosa. Librosa usually used for music and audio analysis. It provides the building blocks necessary to create music information retrieval systems. The code below is used to install the librosa library.

pip install librosa

The code below is used to display audio into waveplot. We are using .au file. You can use another audio format too.

import librosa
import librosa.display
y, sr = librosa.load('') 
librosa.display.waveplot(y, sr=sr)

First we need to import the library. The third line is used to read the audio. It is returning audio signal and sample rate value. By using librosa.display.waveplot the audio can be visualize. y is an audio time series (mono or stereo), and sr is a sampling rate of y. If y is monophonic, a filled curve is drawn between [-abs(y), abs(y)]. If y is stereo, the curve is drawn between [-abs(y[1]), abs(y[0])], so that the left and right channels are drawn above and below the axis, respectively. Waveplot This is the link of the audio visualization code which written in python. We highly recommend you to run the program in jupyter notebook. You can install jupyter notebook by following the instruction in the link below. You can also see another audio visualization in the link below.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *