21.02.2010, 19:18
AWESOME!!
Originally Posted by aNdReSkKkK
do players have to download the client too? or just the host
|
; audio.ini ; ; Notes: ; ------ ; 1. The section names (text enclosed in brackets) correspond to the ; folder names in the audiopacks directory. ; 2. The keys (numbers to the left) are the audio IDs, and the values ; are the file names. ; 3. Remote files must be prefixed with http:// or ftp:// (these do ; not need to be in your audiopacks directory). ; 4. Audio archives are marked by the key "archive" rather than an ; audio ID. The values for these are the archive names. See the ; readme text document in the server package for a list. [default_pack] 1 = test.mp3 |
#include <audio>
// ......... OnPlayerCommandText:
if(strcmp(cmdtext, "/test", true) == 0)
{
Audio_Play(playerid, 1, false, false, false);
return 1;
}
[19:52:10] Server Plugins [19:52:10] -------------- [19:52:10] Loading plugin: audio [19:52:11] *** Audio Plugin v0.4 by Incognito loaded *** [...] [19:30:23] Incoming connection: 127.0.0.1:3547 [19:30:23] [join] Sij_Hogan has joined the server (3:127.0.0.1) [19:30:26] *** Audio Plugin: Incoming connection from 127.0.0.1:3548 [19:30:26] *** Audio Plugin: Sij_Hogan (ID: 3) has connected |
Originally Posted by Incognito
Raphinity: Thanks, it's been fixed. I updated the first post with a new client version that you can just install over your current one. I also fixed a few other small bugs, but nothing major.
SiJ: You probably aren't transferring the audio pack. Look on the previous page—someone had a similar problem. Wicko: You can start the audio stream paused, set its 3D position or volume, and then resume it. Granted, that will be a little slower than sending all of the commands at once, but it should work just as well (depending on how you're using it, of course). It would be pretty easy to make an Audio_PlayEx native, though. I'm not sure I quite understand your second problem. 3D positioning is all client-side—the server just sends the game coordinates and distance one time, so there's no need to check if they're nearby before using Audio_Set3DPosition. I don't know if it's what you're looking for, but you can try using the area detection natives and callbacks in my streamer plugin for more efficient distance checking. |
Originally Posted by Wicko
What I mean is, simply saying, creation (and manipulation) of audio on specific coordinates without a need to create it for every player (and later - for every joining player). It would allow gamemodes to manipulate these sounds (volume, position, even stopping) without a need for storing every listener's ID to apply changes for every stream separately. It requires using relatively big amount of memory and inefficient PAWN loops. I've written a framework to handle the plugin the way I want, but it simply limits me.
Regards |
public
OnPlayerConnect(playerid)
{
new
areaid = CreateDynamicSphere(10.0, 10.0, 10.0, 25.0, -1, -1, playerid),
handleid = Audio_Play(playerid, 1);
Streamer_SetIntData(STREAMER_TYPE_AREA, areaid, E_STREAMER_EXTRA_ID, handleid);
}
public
OnPlayerEnterDynamicArea(playerid, areaid)
{
new
handleid = Streamer_GetIntData(STREAMER_TYPE_AREA, areaid, E_STREAMER_EXTRA_ID);
Audio_Stop(playerid, handleid);
}
Originally Posted by SiJ
BTW I noticed that there are
Audio_AddPlayer() Audio_RemovePlayer() in audio.inc What does they do? |
Originally Posted by SiJ
Another problem:
Remote audio files stops.. here's my audio.ini [music_pack] 1 = Track1.mp3 2 = http://www.mywebsite.com/music/Track2.mp3 If I start ID 1, everything works.. But if I start 2, it shows (messages on Audio_OnPlay and Audio_OnStop) Music has been started (handleid 1) Music has been stopped (handleid 1) BTW It shows that File "Track1.mp3" successfully transfered. Remote file "Track2.mp3" successfully transfered. All files has been transfered. Note: I've changed some default message's texts, but it says something similar.. |
[19:45:28] ------------------------------ [19:45:28] SA-MP Audio Plugin initialized [19:45:28] ------------------------------ [19:46:12] Connecting to 127.0.0.1:9999... [19:46:12] Connected to 127.0.0.1:9999 [19:46:21] Transfer of remote file "http://www.website.com/Track1.mp3" complete [19:46:22] Transfer of remote file "http://www.website.com/Track2.mp3" complete [19:46:39] All files have been processed [19:47:37] Playing: "Track1.mp3" [19:47:37] Stopped: "Track1.mp3" [19:47:41] Playing: "Track2.mp3" [19:47:41] Stopped: "Track2.mp3" [19:47:46] SA-MP Audio Plugin unloaded |
Originally Posted by Incognito
SiJ: What's the URL of the remote file that you're trying to download? Surely it's not http://www.website.com/Track1.mp3, because that isn't a valid MP3 file.
|
Sequence[playerid] = Audio_CreateSequence();
Audio_AddToSequence(Sequence[playerid], 1);
Audio_AddToSequence(Sequence[playerid], 2);
Audio_AddToSequence(Sequence[playerid], 3);
Audio_AddToSequence(Sequence[playerid], 4);
Audio_AddToSequence(Sequence[playerid], 5);
Audio_AddToSequence(Sequence[playerid], 6);
Audio_AddToSequence(Sequence[playerid], 7);
Audio_AddToSequence(Sequence[playerid], 8);
Audio_AddToSequence(Sequence[playerid], 9);
Audio_AddToSequence(Sequence[playerid], 10);
Audio_AddToSequence(Sequence[playerid], 11);
Audio_AddToSequence(Sequence[playerid], 12);
Audio_AddToSequence(Sequence[playerid], 13);
Audio_AddToSequence(Sequence[playerid], 14);
Audio_AddToSequence(Sequence[playerid], 15);
Audio_AddToSequence(Sequence[playerid], 16);
Audio_PlaySequence(playerid, Sequence[playerid]);