SA-MP Forums Archive
PlayAudioStreamForPlayer Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: PlayAudioStreamForPlayer Help (/showthread.php?tid=339279)



PlayAudioStreamForPlayer Help - mprofitt - 02.05.2012

PlayAudioStreamForPlayer(playerid, "http://172.16.40.100/audio_files/event.mp3");

PlayAudioStreamForPlayer(playerid, "http://172.16.40.100/audio_files/event.ogg");

PlayAudioStreamForPlayer(playerid, "http://172.16.40.100/audio_files/event.wav");

Will any of these work or does it have to be a streaming .pls ??

** Issue resolved... Make sure to turn up the volume of the radio in GTA:SA sound options. I had my radio volume at 0 to avoid listening to the single player radio.


Re: PlayAudioStreamForPlayer Help - N0FeaR - 02.05.2012

https://sampwiki.blast.hk/wiki/PlayAudioStreamForPlayer


Re: PlayAudioStreamForPlayer Help - mprofitt - 02.05.2012

Quote:
Originally Posted by N0FeaR
Посмотреть сообщение
-Rep for that....

You dont think I have been there?


Re: PlayAudioStreamForPlayer Help - FalconX - 02.05.2012

As far as I know, you can only use mp3 and ogg.

Well have a look on this link: https://sampwiki.blast.hk/wiki/PlayAudioStreamForPlayer

-FalconX


Re: PlayAudioStreamForPlayer Help - mprofitt - 02.05.2012

Quote:
Originally Posted by FalconX
Посмотреть сообщение
As far as I know, you can only use mp3 and ogg.

Well have a look on this link: https://sampwiki.blast.hk/wiki/PlayAudioStreamForPlayer

-FalconX
-Rep for the reference to the wiki.

I would not have posted if I have not search or read the wiki.
That command does not work for me and the file is available via apache.


Re: PlayAudioStreamForPlayer Help - FalconX - 02.05.2012

Quote:
Originally Posted by mprofitt
Посмотреть сообщение
-Rep for the reference to the wiki.

I would not have posted if I have not search or read the wiki.
That command does not work for me and the file is available via apache.
Well, I've tried to visit your link i.e http://172.16.40.100/audio_files/event.mp3 and I noticed that this link does not work. Try to upload your music somewhere else. Maybe try a free host i.e 000webhost.com

-FalconX


Re: PlayAudioStreamForPlayer Help - mprofitt - 02.05.2012

Quote:
Originally Posted by FalconX
Посмотреть сообщение
Well, I've tried to visit your link i.e http://172.16.40.100/audio_files/event.mp3 and I noticed that this link does not work. Try to upload your music somewhere else. Maybe try a free host i.e 000webhost.com

-FalconX
That is obvioulsy not going to work for you or anyone else on the Internet because it is a RFC1918 private address. It does work on my LAN.


Re: PlayAudioStreamForPlayer Help - FalconX - 02.05.2012

Quote:
Originally Posted by mprofitt
Посмотреть сообщение
That is obvioulsy not going to work for you or anyone else on the Internet because it is a RFC1918 private address. It does work on my LAN.
Then what is wrong? show the errors you get while compiling?

pawn Код:
CMD:audio(playerid, params[])
{
    PlayAudioStreamForPlayer(playerid, "http://172.16.40.100/audio_files/event.mp3");
    return 1;
}
Are you doing something like this?


Re: PlayAudioStreamForPlayer Help - N0FeaR - 03.05.2012

pawn Код:
CMD:audio(playerid, params[])
{
    new Float:x, Float:y, Float:z,Float:distance = 3.0;
    GetPlayerPos(playerid,x,y,z);
    if(IsPlayerInRangeOfPoint(playerid,3.0,x,y,z))
    PlayAudioStreamForPlayer(playerid,"http://172.16.40.100/audio_files/event.mp3",x,y,z,distance,0);
    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
    return 1;
}
try this


Re: PlayAudioStreamForPlayer Help - mprofitt - 03.05.2012

Quote:
Originally Posted by N0FeaR
Посмотреть сообщение
pawn Код:
CMD:audio(playerid, params[])
{
    new Float:x, Float:y, Float:z,Float:distance = 3.0;
    GetPlayerPos(playerid,x,y,z);
    if(IsPlayerInRangeOfPoint(playerid,3.0,x,y,z))
    PlayAudioStreamForPlayer(playerid,"http://172.16.40.100/audio_files/event.mp3",x,y,z,distance,0);
    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
    return 1;
}
try this
Thanks NOFeaR but this fixed it...
https://sampforum.blast.hk/showthread.php?tid=339279