Creating a python audio player using QWebView and HTML5 audio API

I am very new to Python and my first project is pretty ambitious: D

I am trying to create an audio player using QWebView and HTML5 Audio API.

I want to use Phonon to play media files, but I would like to use the HTML5 Audio API to create an equalizer, for example, in Winamp.

I can get Phonon to play the audio file without any problems, but is there any way to connect the audio output to my JavaScript so that I can play with different channels, etc.

Is this even the best way? I mean, what can I do to limit the formats available to my player to those supported by WebKit, or can I still play any format that Phonon can play? (I assume here that Phonon will pass the raw / decoded version of the sound to my JavaScript, which I could use through the Audio API)

If this is not possible, I can make a simple JavaScript wrapper around the Phonon AudioOutput object, I suppose?

Any thoughts?

+8
python html5-audio webkit phonon
source share
1 answer

I did not work with a Qt map, but looked in a QWebView . Documents look as if there is no affordable solution for communicating with a window object.

If you want to work with a familiar protocol, I suggest you look at the Flask micro frame . This is basically a small piece of self-confident code, where all the behavior of the application is provided by functions that receive and then return HTTP request and response objects. Here is the official streaming documentation so you can understand what the response object looks like.

It seems that you understood how to generate the output, this would mean that you would need to run the built-in Flask server at runtime and transmit audio data to the JavaScript client via HTTP.

+1
source share

All Articles