PlayAudioStreamForPlayer delay
#1

Hey SA-MP,

When using PlayAudioStreamForPlayer, if there is a one stream already playing, and you try to start a second one, there is a delay inbetween.

It seems to be that the first stream stops instantly, and the second stream buffers before playing.

Would it be possible to wait for the second stream to buffer before you cut the first stream? This would make the audio flow smoothly.

Here is an example video of the delay.

[ame]http://www.youtube.com/watch?v=SdKPXyTIUCY[/ame]
Reply
#2

This is the first SA:MP video I've ever watched with a voiceover, normally it's subtitles, lol

Some callbacks for when a stream starts/ends would be nice, also.

P.S. Awesome script
Reply
#3

Does need a fix indeed and nice script you got there!
Reply
#4

Though, this delay appears because of the buffer time, like in ******* videos, you need to wait a sec. or two for the video to load. And to be removed, SA:MP would need to use multithreading (You know - to continue playing the previous stream while the new stream is buffering), which I don't think is a good idea.
Reply
#5

wow awesome script... good job man
Reply
#6

My only reason for thinking it might be possible is that you buffer the stream already, so I was hoping the rest of the buffer could be played before playing the new sound, rather than just cutting it off.
Reply
#7

I don't know how the system was implemented: if the stream is loaded each and every time is needed or just the first time.

But if it's the first scenario, then I guess it could be done if samp devs offered the possibility to preload all the needed audio streams, and then, just send the command to the client of which stream to play.
Reply
#8

You can hardly stream audios before stopping another, since it is possible to buffer a stream with nearly no delay (local?) and seems that SA-MP's audio function can only stream 1 audio, unlike audio plugin.
Reply
#9

As the function name suggests, it's designed to play audio streams (mainly internet radio). It can play audio files only because a shoutcast stream and an MP3 stream are the same thing.

I will have a look at it, but to be honest, SA-MP isn't very big on custom content. We're trying to keep everything in SA-MP close to the original San Andreas.
Reply
#10

I really appreciate the honesty Kalcor, I know that it's not the supposed use for it, but the soccer script is a great testament to coding freedom, and the sound part would be the icing on the cake.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)