SA-MP Forums Archive
[Include] Audio Multi Stream - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Audio Multi Stream (/showthread.php?tid=304710)



Audio Multi Stream - Atrox95 - 19.12.2011

SA:MP Multi Stream by Atrox

With this include you can hear two (streamed) sounds "at once".

Example: While you are listening to a radio stream an alarm appears. Your radio stream will be stopped and you hear the alarm.
Using this include the radio stream will be restarted if the alarm is done.
Changelog 1.2:
- fixed StopAudioStreamForPlayerEx
- PlayAudioStreamForPlayerEx will be triggered after the duration time to reset the data
v.1.2
Download Pastebin: http://pastebin.com/Nt4mxxGb

Bugs:
-nothing (Please report)

How to use:

Code:
#include <audiostream>
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/radio",true) == 0) {
        PlayAudioStreamForPlayerEx(playerid, "http://80.237.158.76:80", -1);
    return 1;
}
    if(strcmp(cmdtext, "/sound",true) == 0) {
PlayAudioStreamForPlayerEx(playerid, "http://www.cms.livjm.ac.uk/library/Alice/Alice/Required/sounds/chicken.mp3", 3000);
    return 1;
}
return 0;
}

New functions:

Code:
PlayAudioStreamForPlayerEx(playerid, url[], duration, Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0)
StopAudioStreamForPlayerEx(playerid)
New parameter: duration in milliseconds. (-1 for an unlimited stream, e.g. a radio)



MfG
Atrox


Re: Audio Multi Stream - FireCat - 19.12.2011

Looks nice ^^


Respuesta: Audio Multi Stream - [DOG]irinel1996 - 19.12.2011

Good job bro!


Re: Audio Multi Stream - T0pAz - 19.12.2011

Very useful!


Re: Audio Multi Stream - Niko_boy - 19.12.2011

:O very amazing iDea and useful
SOUNDS AMZING CANT WAIT TO MAKE MANY RADIO WORK TOGETHER WITH A CHICKEN SOUND AS ALARM :P JKING
:P
thanks for it
+1 rep by me


Re: Audio Multi Stream - Astralis - 19.12.2011

very awesome include. Perfect idea,thanks for making this audio multi stream.


Re: Audio Multi Stream - Atrox95 - 19.12.2011

Changelog 1.2:
- fixed StopAudioStreamForPlayerEx
- PlayAudioStreamForPlayerEx will be triggered after the duration time to reset the data

Thank you for your feedback!


Re: Audio Multi Stream - Nenad - 19.12.2011

Nice idea adding duration parameter :P


AW: Audio Multi Stream - Atrox95 - 05.01.2012

Could you give me an feedback whether your server will crash if you start a sound more times at once.


Respuesta: Audio Multi Stream - LULU - 08.01.2012

Bug? no loop music..


AW: Audio Multi Stream - Atrox95 - 14.04.2012

Loop music works, if you set the duration parameter to -1.