[Include] Audio Multi Stream
#1

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
Reply
#2

Looks nice ^^
Reply
#3

Good job bro!
Reply
#4

Very useful!
Reply
#5

: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
Reply
#6

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

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

Thank you for your feedback!
Reply
#8

Nice idea adding duration parameter :P
Reply
#9

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

Bug? no loop music..
Reply
#11

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


Forum Jump:


Users browsing this thread: 1 Guest(s)