Facepunch / garrysmod-requests

Feature requests for Garry's Mod
84 stars 24 forks source link

Allow one stream from sound.PlayURL to be played in multiple locations #125

Open AusHick opened 10 years ago

AusHick commented 10 years ago

When using sound.PlayURL to create a sound in the world, you cannot create a copy of it anywhere else without creating a completely new object. When you do this with things such as streams from Shoutcast servers, the sound sources can be out-of-sync because it opens a new stream for each object. Can we get a way to make multiple sound sources using the same stream so that the client only needs one open connection per URL?

handsomematt commented 10 years ago

sound.PlayURL has options for "3d" and "noplay", it also has a callback which returns a soundchannel.which you can set the position of.

AusHick commented 10 years ago

I'm aware of that. But, that doesn't solve the problem of wanting to use the same stream in multiple places at the same time?

AusHick commented 10 years ago

Seeing all the IGModAudioChannel updates, bump?

UnderscoreKilburn commented 10 years ago

I'm not even sure that's possible with the way audio channels work at the moment. You can somewhat do that by using the "noblock" option to disable streaming in blocks and then using SetTime to sync all the streams, but you still need to open multiple streams. I'll try to look for a way to create a copy of an existing stream without actually opening a new connection but I really can't guarantee anything.

AusHick commented 10 years ago

Sounds good. I just need some way to keep the streams in sync because if I have a bunch of radios on the same station within audible range, then it gets pretty wonky sounding. That just seemed like the most logical way to do it to me.

AusHick commented 10 years ago

-bump-

Has any progress been made on this?

Grocel commented 9 years ago

I would like to have it too. BASS has some function to split and join channels, but they have to be decoding ones or something (I'm not sure), which makes them completely useless or at least very tricky for GMod, I guess.

AusHick commented 8 years ago

Can any fresh eyes take a look at this? Creating a radio system in-game where the audio is streamed from online is impossible to do properly because each channel opens a new stream. That mean each instance is off by half of a second roughly, and when the radios are in the same area, it will really drive you crazy.

thegrb93 commented 8 years ago

IGmodAudioChannel:Copy(), returns another channel with the same current time and source would be cool.

Meanwhile you can just use a non 3d channel and control its volume by how far the player is from the various points.

AusHick commented 8 years ago

3D is kinda a necessity. But when I have 2 identical Shoutcast streams playing, and they are each off by just a hair, it sucks.