SA-MP Forums Archive
doubt - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: doubt (/showthread.php?tid=654400)



doubt - dani18 - 27.05.2018

Is there any way to convert a song or track to the "PlayerPlaySound" function? It would be great, because in the servers there is a lot of lag to call the link of a song.


Re: doubt - Exhibit - 27.05.2018

I don't think that's possible.


Re: doubt - Mugala - 28.05.2018

that's not possible. PlayerPlaySound is called from player's audio bank.


Re: doubt - Kaliber - 28.05.2018

But you can use https://sampwiki.blast.hk/wiki/PlayAudioStreamForPlayer


Re: doubt - dani18 - 28.05.2018

Quote:
Originally Posted by Kaliber
Посмотреть сообщение
Dude, that's where the link of an audio track is technically placed, but still thanks for commenting


Re: doubt - Sew_Sumi - 28.05.2018

If it's lagging them out they either need a better connection, you need a better host for the mp3, or you need a lower bitrate MP3.

None of this would be fixed by anything in the script itself.


Re: doubt - NaS - 28.05.2018

The Audio Plugin is probably the only real alternative to Audio Streaming. For people who do not have it you can still use Audio Streams.

Theoretically you could offer the Sound Bank Files to download but let's be honest - noone will download that.

Depending on your playerbase it may also make sense to have multiple hosts for the Streams in different Countries, so you can use the closest host for each player. That will reduce the delay before a sound starts to play (unless it's the player's connection).


Re: doubt - Sew_Sumi - 28.05.2018

Actually, if it's the gap before it starts streaming, I now find I'm noticing that in a script I have currently. Takes about 4-5 seconds + for it to start up.


Re: doubt - NaS - 28.05.2018

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
Actually, if it's the gap before it starts streaming, I now find I'm noticing that in a script I have currently. Takes about 4-5 seconds + for it to start up.
There are also differences in the delay between formats. Try using 64 kbps M4A/AAC vs. 64 kbps MP3. The M4A will start playing earlier than an MP3 (which needs a fair amount of data before it can be played).

You can notice this if you play an AAC audio stream on bad connections, the first second or so will sound like very low quality, and once the buffer is filled it will improve to the original quality - which means you can use higher quality M4A codecs with the same delay as a LowQ MP3.

Also, do not include ID3 Tags and no cover picture in MP3 files. They are in the header which effectively highers the delay before any actual audio data is transmitted.