PlayAudioStreamForPlayer does not loop my .pls
#1

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

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

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

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

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

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

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

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

Welcome to the world of coding.
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)