PDA

View Full Version : PlayAudioStreamForPlayer Help


mprofitt
02/05/2012, 10:40 PM
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.

N0FeaR
02/05/2012, 10:45 PM
http://wiki.sa-mp.com/wiki/PlayAudioStreamForPlayer

mprofitt
02/05/2012, 10:46 PM
http://wiki.sa-mp.com/wiki/PlayAudioStreamForPlayer

-Rep for that....

You dont think I have been there?

FalconX
02/05/2012, 10:47 PM
As far as I know, you can only use mp3 and ogg.

Well have a look on this link: http://wiki.sa-mp.com/wiki/PlayAudioStreamForPlayer

-FalconX

mprofitt
02/05/2012, 10:50 PM
As far as I know, you can only use mp3 and ogg.

Well have a look on this link: http://wiki.sa-mp.com/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.

FalconX
02/05/2012, 10:55 PM
-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

mprofitt
02/05/2012, 11:07 PM
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.

FalconX
02/05/2012, 11:18 PM
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?


CMD:audio(playerid, params[])
{
PlayAudioStreamForPlayer(playerid, "http://172.16.40.100/audio_files/event.mp3");
return 1;
}


Are you doing something like this?

mprofitt
02/05/2012, 11:26 PM
Then what is wrong? show the errors you get while compiling?


CMD:audio(playerid, params[])
{
PlayAudioStreamForPlayer(playerid, "http://172.16.40.100/audio_files/event.mp3");
return 1;
}


Are you doing something like this?

I don't get any errors while compiling. I did have Iconitoes Audio Client installed so I uninstalled Incognitos Audio Client, uninstall / reinstalled SAMP, removed the plugin / inc from the script and all related functions. The script function fine, I just dont hear any sound when the function is called.

+Rep for hangin in there with me.

FalconX
02/05/2012, 11:35 PM
I don't get any errors while compiling. I did have Iconitoes Audio Client installed so I uninstalled Incognitos Audio Client, uninstall / reinstalled SAMP, removed the plugin / inc from the script and all related functions. The script function fine, I just dont hear any sound when the function is called.

+Rep for hangin in there with me.

http://somafm.com/tags.pls try this instead of your music. And ty for the rep lol. I don't think the Incognito's Audio client is necessary you just need 0.3d PAWNO and a client also it won't work in the previous versions. It's strange that the music ain't working. Just give a try with the link I gave you now.

mprofitt
02/05/2012, 11:45 PM
http://somafm.com/tags.pls try this instead of your music. And ty for the rep lol. I don't think the Incognito's Audio client is necessary you just need 0.3d PAWNO and a client also it won't work in the previous versions. It's strange that the music ain't working. Just give a try with the link I gave you now.

I tried the link using this code and it doesnt work in SAMP. I tried it in Winamp and it works fine.

CMD:audio(playerid, params[])
{
PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls");
return 1;
}

N0FeaR
03/05/2012, 06:34 AM
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,b onnet,boot,objective);
return 1;
}

try this

mprofitt
03/05/2012, 02:11 PM
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,b onnet,boot,objective);
return 1;
}

try this

Thanks NOFeaR but this fixed it...
http://forum.sa-mp.com/showthread.php?t=339279