rowisahub / PodcastBotWIP

send audio from calls to a other call
2 stars 1 forks source link

Merging two or more streams with merge-stream #2

Open DarkenLM opened 3 years ago

DarkenLM commented 3 years ago

So after looking at your code, if you want to join multiple streams, this code might work:

function joinStreams(streams) {
  let merged = mergeStream()
  for (let i in streams) {
    merged.add(streams[i])
  }
  return merged
}

let merged = joinStreams(stream1, stream2, ...)
rowisahub commented 3 years ago

let merged = joinStreams(stream1, stream2, ...)

My question, does this work even with new stream? Like if someone joins later in the call can i call this function again? And if i can, how?

DarkenLM commented 3 years ago
let merged = joinStreams(stream1, stream2, ...)

...

let merged2 = joinStreams(merged, stream1)

Let me know it it works.

rowisahub commented 3 years ago

Ok, i will try later. Thanks

rowisahub commented 3 years ago

but doesn't that just overlap each other and basically stop 1 stream going over the other?

rowisahub commented 3 years ago

and how would i remove a stream?

Weppman commented 3 years ago

Did you ever get this working

Jiron commented 1 year ago

Any updates on this?