Audio visualisation by parameters via pygame library

Hello. I’m using pygame. I need code example which fetch different parameters(frequency, volume, … , other) from mp3 in real time moment and draw it the window of pygame.
And so I’m gonna get:
where [x]: is a for e.g. frequency.
and [y]: is a value, but in real time., like in visual equalizer implementation in most popular audio players under windows platform. But I don’t know which parameters consist of mp3 audio file and how to make drawing chart from that. Help me please. It have to making like this but I need also above talking MyArray[x][y]:

Could S.o.m.e.o.n.e. help me?

You aren’t likely to find someone who will do it for you. Try to do it yourself, and ask for help if you get stuck.

I found something, but don’t understand how to draw a my own chart (just Cartesian Diagram with (x,y)). Can you help me to modify this code for that purposes.:

import sys, math, wave, numpy, pygame
from pygame.locals import *
from scipy.fftpack import dct
import random

Number = 30 # number of bars
HEIGHT = 600 # HEIGHT of a bar
WIDTH = 40 #WIDTH of a bar
FPS = 10

file_name = sys.argv[0]
status = 'stopped'
fpsclock = pygame.time.Clock()

#screen init, music playback

screen = pygame.display.set_mode([Number * WIDTH, 50 + HEIGHT])
pygame.display.set_caption('Audio Visualizer')
my_font = pygame.font.SysFont('consolas', 16)"0.wav")
status = "Playing"

#process wave data

f ="0.wav", 'rb')
params = f.getparams()
nchannels, sampwidth, framerate, nframes = params[:4]
str_data = f.readframes(nframes)
wave_data = numpy.fromstring(str_data, dtype = numpy.short)
wave_data.shape = -1, 2
wave_data = wave_data.T

num = nframes

def Visualizer(nums):
    num = int(nums)
    h = abs(dct(wave_data[0][nframes - num:nframes - num + Number]))
    h = [min(HEIGHT, int(i**(1 / 2.5) * HEIGHT / 100)) for i in h]

def vis(status):
    global num
    if status == "stopped":
        num = nframes
    elif status == "paused":
        num -= framerate / FPS
        if num > 0:

def get_time():
    seconds = max(0, / 1000)
    m, s = divmod(seconds, 60)
    h, m = divmod(m, 60)
    hms = ("%02d:%02d:%02d" % (h, m, s))
    return hms

def controller(key):
    global status
    if status == "stopped":
        if key == K_RETURN:
            status = "playing"
    elif status == "paused":
        if key == K_RETURN:
            status = "stopped"
        elif key == K_SPACE:
            status = "playing"
    elif status == "playing":
        if key == K_RETURN:
            status = "stopped"
        elif key == K_SPACE:
            status = "paused"

def draw_bars(h):
    bars = []
    for i in h:
        bars.append([len(bars) * WIDTH , 50 + HEIGHT - i, WIDTH - 1, i])
    for i in bars:
        pygame.draw.rect(screen, ChangeColor(0,1,1), i, 0)
       # pygame.draw.rect(screen, ChangeColor(255,1,1), 1, 0)
def ChangeColor(AA,OO,UU): 
    if AA==1:
        AA= random.randint(0, 255)
    if OO==1: 
        OO= random.randint(0, 255)    
    if UU==1:   
        UU= random.randint(0, 255)
    return (AA,OO,UU)

while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
        elif event.type == KEYDOWN:

    if num <= 0:
        status = "stopped"

    name = my_font.render(file_name, True, ChangeColor(255,255,255))
    info = my_font.render(status.upper() + "" + get_time(), True, ChangeColor(255,255,255))
    screen.blit(info,(0, 18))
    for event in pygame.event.get():  
        if event.type == pygame.QUIT:
           print('Application Closed')
        if event.type == pygame.MOUSEWHEEL:
            if event.y==1:
              print("Pressed Up!")
            elif event.y==-1:
              print("Pressed Down!")