Vista's profile picture

Published by

published
updated

Category: Web, HTML, Tech

a radio station in scratch - how it would work, issues that may occur and limitations

im a big fan of radio stations. i have at least 4 radios set up in my house, i have a radio station of my own, and love listening to different frequencies to see what i can find. 


another thing i like is scratch. while i dont use scratch all too often anymore (i prefer c# or python) i have had a look at turbowarp. and wow. its pretty insane. you can enable iframes, video playback, audio playback, 2d physics, unix time and the list goes on. but in my opinion, the most interesting addon is a thing called "cloudlink"


to put it simply, cloudlink allows for support with servers. you can host your own, or use the public servers already available.

scratch already has that though" you may be thinking. and you would be right. sort of.


scratch, on its own CAN connect to a server, but its quite limited.

you can only use their own server, you cant send requests to other projects and the worst part is: you can only store numbers.


now i want to make a radio station. i need to send requests to play music to other users, tell them how long the song is maybe, i may also need to give them the id of the song, and also give metadata so the users know what song they are listening to. 

first of all, i doubt that scratch can handle all that at an acceptable speed, and i dont want other users being able to also host songs over my songs, so we would need to split the hosting project up with the client project. scratch, as mentioned before cannot do this.


solution? just use cloudlink.

not only can we send requests with any character, we can also create rooms, allow users to select different names, and most importantly: send and receive json files between projects.


that means we could store the metadata of the song, the length, the id of the song into a JSON file and then send it to the client project using a host project. the client project will then look through the files of the project to find the song id, show what the song is called, it's length and how far we are into the song. 


another issue is: how do we make the song play at a certain time??


you could change the pitch until we reach the desired length, but thats unreliable and seems to fail quite often, so i am actually quite stuck here. does anyone know of any extensions that can start music at a certain time? if so, please tell me.


0 Kudos

Comments

Displaying 0 of 0 comments ( View all | Add Comment )