Jump to content

PLS to Sound3D


.:HyPeX:.

Recommended Posts

Hey guys, how can i create a PlaySound3D with any Stream radio? i know direct link like IP is supported and works but.. it doenst display all the stuff like author, etc.

i wanted to make this PLS work:

  
[playlist] 
NumberOfEntries=8 
File1=http://pub5.di.fm:80/di_chilloutdreams 
Title1=Digitally Imported - Chillout Dreams 
Length1=-1 
File2=http://pub3.di.fm:80/di_chilloutdreams 
Title2=Digitally Imported - Chillout Dreams 
Length2=-1 
File3=http://pub8.di.fm:80/di_chilloutdreams 
Title3=Digitally Imported - Chillout Dreams 
Length3=-1 
File4=http://pub1.di.fm:80/di_chilloutdreams 
Title4=Digitally Imported - Chillout Dreams 
Length4=-1 
File5=http://pub7.di.fm:80/di_chilloutdreams 
Title5=Digitally Imported - Chillout Dreams 
Length5=-1 
File6=http://pub6.di.fm:80/di_chilloutdreams 
Title6=Digitally Imported - Chillout Dreams 
Length6=-1 
File7=http://pub2.di.fm:80/di_chilloutdreams 
Title7=Digitally Imported - Chillout Dreams 
Length7=-1 
File8=http://pub4.di.fm:80/di_chilloutdreams 
Title8=Digitally Imported - Chillout Dreams 
Length8=-1 
Version=2 

Link to comment
Only some internet radios support 'dynamic' metas. Such as current artist and song, so don't expect each and every one to have it.

Most "professional" ones have, though. You'll just have to try your way to see what radios use them or not. You do not need any API, only getSoundMetaTags.

I'm using visualiser resource as core, so i know whenever its working or not :/

Link to comment

You indeed don't need an api, LOL...

Well, here's my code (ofcourse I used a costum drawing system)

  
  
addEventHandler("onClientSoundStream", root, 
    function(success, length, streamName) 
        if streamName then 
            local veh = getPedOccupiedVehicle(getLocalPlayer()) 
            if veh then 
                if radioSound[veh] == nil then return end 
                if radioSound[veh].soundElement == source then 
                    outputChatBox("#FFFFFFRadio stream: #22AA22 " .. streamName, 0, 0, 0, true) 
                end 
            end 
        end 
    end 
) 
addEventHandler("onClientSoundChangedMeta", root, 
    function(streamTitle) 
        if streamTitle then 
            local veh = getPedOccupiedVehicle(getLocalPlayer()) 
            if veh then 
                if radioSound[veh] == nil then return end 
                if radioSound[veh].soundElement == source then -- as you can see here, we check if the sound source = on the vehicle element 
                    outputChatBox("#FFFFFFRadio meta: #AA2222 " .. streamTitle, 0, 0, 0, true) -- this was outputting all the songs properly. 
--[[ 
message1 = streamTitle 
showRadio(false,message1,1) 
]]-- 
                end 
            end 
        end 
    end 
) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...