SA-MP Forums Archive
PlayAudioStreamForPlayer does not loop my .pls - 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: PlayAudioStreamForPlayer does not loop my .pls (/showthread.php?tid=320135)



PlayAudioStreamForPlayer does not loop my .pls - decondelite - 21.02.2012

Hello fellow SA-MP scripters.

Today I decided to start playing around with PlayAudioStreamForPlayer, to have a nice music on the selection screen of my server. I use it to play a playlist "Music.pls" that contains only one track, so that track should loop.

When I open that playlist with VLC, I do get the track looped. But when I play that playlist in SA-MP, my track does get played once, but in the end of it I just get a big noise and then nothing.

My playlist:
http://battlefield.cod5samp.com/AGMUSIC/Music1.pls

Quote:

[playlist]
File1=http://battlefield.cod5samp.com/AGMUSIC/Music1.mp3
Title1=COD5 Armageddon - Ride Of The Walkyries
Length1=-1
NumberOfEntries=1
Version=2

Have I done something a wrong way?


Re: PlayAudioStreamForPlayer does not loop my .pls - MP2 - 21.02.2012

I don't think you can loop mp3 files. It has to be a stream.


Re: PlayAudioStreamForPlayer does not loop my .pls - decondelite - 21.02.2012

That's not a matter of looping a file or not: I'm using a PLAYLIST in my server code.

PlayAudioStreamForPlayer(playerid,"http://battlefield.cod5samp.com/AGMUSIC/Music1.pls");

As far as I know, playlists are supposed to work in SA-MP, and in my case it doesn't work very well.


Re: PlayAudioStreamForPlayer does not loop my .pls - MP2 - 21.02.2012

Yes but it's still only being told to play the mp3 file - which does not loop. Streams are a constant broadcast.


Re: PlayAudioStreamForPlayer does not loop my .pls - decondelite - 21.02.2012

Then how can I get it looping / have a constant stream?


Re: PlayAudioStreamForPlayer does not loop my .pls - MP2 - 21.02.2012

Well, you can't even loop it with pawn because there's no OnAudioStreamFinishForPlayer ¬_¬


Re: PlayAudioStreamForPlayer does not loop my .pls - decondelite - 21.02.2012

I tried to put the track 3 times in a row, but it plays only once... :/

[playlist]
File1=http://battlefield.cod5samp.com/AGMUSIC/Music1.mp3
Title1=COD5 Armageddon - Ride Of The Walkyries
Length1=-1
File2=http://battlefield.cod5samp.com/AGMUSIC/Music1.mp3
Title2=COD5 Armageddon - Ride Of The Walkyries
Length2=-1
File3=http://battlefield.cod5samp.com/AGMUSIC/Music1.mp3
Title3=COD5 Armageddon - Ride Of The Walkyries
Length3=-1
NumberOfEntries=3
Version=2


Re: PlayAudioStreamForPlayer does not loop my .pls - decondelite - 21.02.2012

Well I don't really want to use timers, as it'd be quite a mess to manage (timer ids stored in pvars, pvars to check upon spawn...). I rather think that the sound will play only once and that's it.

But still I think that I've got a friend who managed to have a radio with several tracks on it. I'll ask him how he did that.


Re: PlayAudioStreamForPlayer does not loop my .pls - Scenario - 21.02.2012

Welcome to the world of coding.


Re: PlayAudioStreamForPlayer does not loop my .pls - decondelite - 21.02.2012

Quote:
Originally Posted by RealCop228
View Post
Welcome to the world of coding.
Except that it's been 3 years that I'm coding in SA-MP, and 7 years in my whole life...