[Plugin] Audio Plugin

AWESOME!!

Reply

do players have to download the client too? or just the host
Reply

Quote:
Originally Posted by aNdReSkKkK
do players have to download the client too? or just the host
Client too.
Reply

Nice whens 0.5 coming out?
Reply

Hello, I'm reporting a little bug. If somebody else could confirm it...

It occurs in a specific situation : the audio plugin broadcasts two audio streams in same time, and "Audio_Stop" is used to stop one of the audio stream (corresponding to its handleid).

- case 1 (no bug) : no audio stream are downmixed, and "Audio_Stop" stops only the handleid that it has to stop.

- case 2 (bug) : same situation, but one of the audio stream is downmixed. In stoping the audio stream which is not downmixed, it also stops the other one which is downmixed.

There is maybe an explanation.

N.B. It's only a problem if we also want to use some effects with "Audio_SetFX" and "Audio_SetEAX" because we must downmix the stream to mono.

Thank you.
Reply

I don't know what is wrong but here's my problem:
I've added the plugin to my server.. It starts, everything should be ok, but music file doesn't play (I'm trying on local server, from my PC)
Here is my audio.ini (which is in main server directory):
Quote:

; 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

There is a test.mp3 in \audiopacks\default_pack\

I have a line:
pawn Код:
#include <audio>

// ......... OnPlayerCommandText:
if(strcmp(cmdtext, "/test", true) == 0)
    {
      Audio_Play(playerid, 1, false, false, false);
      return 1;
    }
But it just doesn't work.. Here is a part of server log:

Quote:

[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

I type /test and nothing happens..
Reply

Hi, it's me again.
Well we've been using the plugin for a while now and I've got a few thoughts. Requests actually.

The first one is relatively simple I think. I thought of Audio_PlayEx(), which would allow me to set sound's volume and 3d position. Right now setting volume or 3Dpos on a short audio just doesn't make any difference or it applies after a short while of playing, which seriously doesn't sound nice.

The second one is far more complicated. Even after you've added support for ingame coordinates in 0.4, there's still no easy and efficient way to create a sound in a place, which would be streamed only to players who are close enough (not to waste the bandwidth). As a result I support the streaming in PAWN. I have to create an array of ongoing streams and check whether players are close enough. If so, I run the stream and set it's 3D position for each player. It one gets too far away I turn it off. It's PAWN, which also means it's inefficient.

If you'd make anything like Audio_PlayInPlace, PlayOnCoordinates or whatever, you could return a single ID, which we could easily modify or remove. It would speed up the process so much - at the moment we've got to care about all the IDs for every player, which is a pain in the ass really.
But there's more. As you wouldn't deal with PAWN but with the TCP server, the distance checking code could possibly be run in a separate thread every second or so.

Regards.
Reply

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.
Reply

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
Reply

Quote:
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.
Oops.. I just realized that I missed the last part of your tutorial ("In your gamemode, make sure that these things are present:")
I'm soo stupid


BTW I noticed that there are
Audio_AddPlayer()
Audio_RemovePlayer()
in audio.inc
What does they do?
Reply

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..
Reply

Quote:
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
Couldn't you simply do this, then?

pawn Код:
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);
}
That's just an illustration, but it looks like what you're wanting to do can be handled sufficiently with the streamer plugin. If not, maybe you could explain a little more.

Quote:
Originally Posted by SiJ
BTW I noticed that there are
Audio_AddPlayer()
Audio_RemovePlayer()
in audio.inc
What does they do?
They're for adding players to the plugin's internal list so that names and IP addresses can be authenticated. You don't need to use them in your script since this is done automatically in the include file.

Quote:
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..
Are you sure that the remote file is transferring? Is it present in %APPDATA%\audiopacks? What does your audio.txt log file say?
Reply

I just noticed that the audio files in
%APPDATA%\audiopacks (\Application Data\SA-MP Audio Plugin\audiopacks\MyAudio_Pack) are created but the filesize is 99kb for all the files (their original size is 3-4mb)... Where's the problem? :\

Logfile:
Quote:

[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

When I connect again to the same server, files PASSES CRC check.. :\

PROBLEM SOLVED!
Reply

awesome but no work
Reply

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.
Reply

Quote:
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.
<---- is an exemple
Reply

SOLVED!
Reply

hey can anybody tell me how to stop a sequence? Audio_Stop doesnt work and Audio_DestroySequence neither

i got

pawn Код:
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]);
Reply

This is so cool! Works!

Good work! Rly good one.
Reply

Suggestion:
You could make an app which would allow users to remove audio files in %APPDATA%..
Reply


Forum Jump:


Users browsing this thread: 27 Guest(s)