[Release] [JS] Radio

hi i hope you guys can help me, i have a rp server and i would love to use this on it, i have put the radio file in resources and ofc start radio. and i have it like this in lua :
resource_manifest_version “44febabe-d386-4d18-afbe-5e627f4af937”

– Example custom radios
supersede_radio “[RADIO_03_HIPHOP_NEW]” { url = “[http://stream.radioreklama.bg:80/nrj_low.ogg]”, volume = 0.5, name = “[RADIO ENERGY]” }
supersede_radio “[RADIO_04_PUNK]” { url = “[http://revolutionradio.ru/live.ogg]”, volume = 0.5, name = “[Revolution Radio OGG]” }
supersede_radio “[RADIO_05_TALK_01]” { url = “[http://stream.radioreklama.bg:80/radio1rock.ogg]”, volume = 0.5, name = “[RADIO 1 ROCK]” }
supersede_radio “[RADIO_08_MEXICAN]” { url = “[http://mp3.stream.tb-group.fm:80/tt.ogg]”, volume = 0.5, name = “[TechnoBase.FM]” }

files {
“index.html”
}

ui_page “index.html”

client_scripts {
“data.js”,
“client.js”
}

And this dont work, just normal radio stations in the game.

1 Like

Remove the brackets, you should have something like this:

supersede_radio "RADIO_03_HIPHOP_NEW" { url = "http://stream.radioreklama.bg:80/nrj_low.ogg", volume = 0.5, name = "RADIO ENERGY" }
supersede_radio "RADIO_04_PUNK" { url = "http://revolutionradio.ru/live.ogg", volume = 0.5, name = "Revolution Radio OGG" }
supersede_radio "RADIO_05_TALK_01" { url = "http://stream.radioreklama.bg:80/radio1rock.ogg", volume = 0.5, name = "RADIO 1 ROCK" }
supersede_radio "RADIO_08_MEXICAN" { url = "http://mp3.stream.tb-group.fm:80/tt.ogg", volume = 0.5, name = "TechnoBase.FM" }
1 Like

Did you ever fix the issue with it not working when you get in the car sometimes? Or is that just a glitch that is stuck with the streaming of it

1 Like

thank you so mutch,. it worked .

Hi i have to say one more time thanks for the help. but the volume is pretty high and i set it down from 0.5 to 0.2 and it got higher :stuck_out_tongue: hehe but it works great :smiley:

Hi, it’s now fixed with the latest release. Thanks for your feedbacks.

//Edit: Fixed. Thanks.

just a quick question. i want to play music i pick and put in a folder how would one go about that?

I can’t seem to figure out why I keep getting the “Could not load resource Radio” when I try to connect. I’ve put it in my resources folder:

And started it in the server config:

It even says it starts fine without any errors when running the server

But it still gives me that error when connecting to the server with my client…Any ideas?

@Iwan
This resource works, right now I tested it.
You need to find radio stations that emit in ogg not aac + or mp3 .
If you can not find it you can convert a mp3 to ogg and upload into web hosting, take link ( ex: “http://yourwebsite.com/song.ogg”) and put into __resource.lua and work great .

Very very nice! Thx!

Is it possible to use a link like “http://sunshine-live.radio.de/” ?

Not really working for me, whats wrong? I see no “New Radio Sign or Text” and here no new Musik also not for the Musiklinks upstairs

You have to edit in index.html :

<script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.0.9/howler.core.min.js"></script>

by

<script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.0.10/howler.core.min.js"></script>

And it should work, at least, it worked for me right now !

Don’t forget to put a link which point on an ogg file like it was showed before and it must be alright !

Have fun

will check it again…sounds are on.

Made my own playlist (mp3 file) and converted it to a ogg file? how do i play it via the radio? the ones in the _resource file are urls? great job btw ^^

1 Like

ive been trying to do this for hours now this Radio seems not to work anymore ive tryed everthing. even changed

<script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.0.9/howler.core.min.js"></script>

TO

<script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.0.12/howler.core.min.js"></script>

noting seems to work only regular stations,

if anyone knows how to just change the radio Stations sound files so u can stream ogg i would gladly appreciate it

1 Like

I’m using this as a reference for a JS only resource, but am having trouble getting my NUI callback to fire after my index.html posts / fetches. I tried downloading Radio and inserting a ‘debug’ emit(‘chatMessage’, …) in the nui callback event listener, but I didn’t see it firing either.

Does the Javascript nui stuff actually work for you? I’m trying to figure out if the problem’s on my side or if it’s an issue with nui.

Edit: I found my error. Just a typo in a variable name.

work as intend but when i am changing cars the radio stops and i got to restart the resource in order to continue listening to the second car,otherwise its only playing for the first car i enter and only for that car

1 Like

hi i place this in and nothign plays

– Example custom radios
supersede_radio “RADIO_02_POP” { url = “https://tunein.com/radio/NEON-Radio-s122451/”, volume = 0.2 }
supersede_radio “RADIO_03_HIPHOP_NEW” { url = “https://tunein.com/radio/KISSTORY-s77960/”, volume = 0.2 }
supersede_radio “RADIO_04_HIPHOP_NEW_HIPHOP_NEW” { url = “https://tunein.com/radio/LBC-UK-s220687/”, volume = 0.2 }
supersede_radio “RADIO_05_HIPHOP_NEW” { url = “https://listen.thisisqhr.co.uk/public/this_is_qhr/embed#”, volume = 0.2 }

where should i install the file ?