Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

AudioSubscribers and Null

Avatar

Level 4

Hi,

So Im trying to listen to 3 users in a room Host, Player 1 and Player 2. so i got somthing like this:

view.audioSub.publisherIDs = [service.OwnerCamID, service.PlayerCamID, service.SecondPlayerCamID];

Each item in the array represents a LCCS ID.

So what if any one of these turn out to be null? Do i loose the audio for everyone?

Also since this is an array If i have something like this in my code in a few places. Could I be adding the same users more than once. I see in the room console that I have multiple audio subscriptions to the same person as i switch them bewteen subscribers

(big cam subscriber vs. little cam subscribers)

If so then im guessing it will effect performance.

thanks.

...russ

2 Replies

Avatar

Level 10

Hey ...russ,

Actually, check out the code in AudioSubscriber for when you set

publisherIDs. It's actually smarter than I'd guessed (go Basu!) - what it

does is immediately take the publisherIDs Array and turn it into a

"whitelist" (_publisherIDTable[pubID]=true) of streams it's allowed to play.

When it comes time to play all streams, it just goes through the entire set

of audio streams in the room, and checks each against _publisherIDTable to

see if there's a true for that pubID. Duplicate entries shouldn't matter,

and nor should nulls. You should be good to go.

nigel

Avatar

Level 4

This sounds great. I'll take a look.

Im going to guess that video has something similar?

thanks!

...russ