Flask: Stream Radio

Asked

Viewed 136 times

0

This is the first that I will try to embark on project of this style and I have some doubts that I would like to clarify, this may sound very lay.

I will use Flask for development and radio is established on the platform SHOUTcast, connect me behind a IP:PORTA. I’m slowly starting to understand the architecture of Flask, had already made a small design using it and liked it quite.

Now to create an audio player, how can it be done? Using Python, HTML? I still can’t understand how to work with it.

Can be used Plyr ?

  • It’s unclear what you want to do. Want to make an audio streaming server? Want to make a web audio player?

  • So, I would like to broadcast this broadcast through a player, right? In what way do I do this

  • Radio is already staying at SHOUTcast, I get an IP:PORT, now you need to have a player on the web

  • I discovered a generator of my own SHOUTcast. https://shoutcastwidgets.com/flash_player_generator.php I believe this will help me

1 answer

1


If you already have the separate streaming server, what you need is to get a tag to the browser "<audio />" with the appropriate parameters - this is the part you do in flask.

The recommendation is you test with a static page before - here is good documentation: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio

when it’s ok, if it’s the same link for all users, you can leave the static tag, or, if you fill in the audio element and server address, etc.. in the template, with variables that are managed in the Python view.

If your end application is of the "web application" type - where you keep a single HTML page and update it with asynchronous requests to the server - the same thing - effectively the Python view will pass the URL to the server, and the Javascript part of your app will create the audio tag with these parameters.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.