Posts: 253
Threads: 15
Joined: Jul 2006
Reputation:
0
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]
Posts: 6,236
Threads: 310
Joined: Jan 2011
Reputation:
0
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
Posts: 663
Threads: 42
Joined: May 2009
Reputation:
0
Does need a fix indeed and nice script you got there!
Posts: 2,286
Threads: 18
Joined: Jun 2010
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.
Posts: 791
Threads: 65
Joined: Oct 2009
Reputation:
0
wow awesome script... good job man
Posts: 253
Threads: 15
Joined: Jul 2006
Reputation:
0
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.
Posts: 622
Threads: 5
Joined: Feb 2009
Reputation:
0
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.
Posts: 1,496
Threads: 78
Joined: Jun 2008
Reputation:
0
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.
Posts: 1,180
Threads: 55
Joined: Apr 2005
Reputation:
0
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.
Posts: 253
Threads: 15
Joined: Jul 2006
Reputation:
0
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.