Howto: play audio and dynamically change src using django

It’s not a question. I used this post to add audio data using html5 player on this page
code is here

3 Likes

This is cool but I have no idea what the heck is happening :sweat_smile: … The audio seems to be playing different tones even though I’m not touching the sliders/changing things? Can you elaborate on how this works?

1 Like

you must set frequency=cy and amplitude
image

and wait.
When you move slider wav data are changing then data played stop .

Click in the slider and do not drag it

I changed I use ,syncable=True in slider constructor it seems better

It became a bit more evident what was going on when I did an x-zoom out:

Maybe the x-range could be decreased so the waveform can be seen in more detail?

Also if you respond to value_throttled on the sliders (instead of value), then you can have it only update when a slider move “finishes” and not all the intermediate values.

This is very cool!

2 Likes

Thanks it’s much better with value_throttled

About x_range I want student to use zoom. I added a comment ( in french)

1 Like

Yes! I was going ham on the sliders and listening to changing tones… as the sounds tried to catch up with my actions → was very confused as to what was happening. Value throttled is wayyy better :smiley:

1 Like

Neat, I made a C chord via Frequencies of Musical Notes, A4 = 440 Hz

1 Like