Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Auditioning camera and microphone in LCCS app?

Avatar

Level 2

I'm fairly new to LCCS, and I'm not sure how the AudioPublisher and WebCamPublisher classes work with respect to Camera and Microphone intrinsic classes. I'm building a "green room" or auditioning component in Flex, and I'd like to enable the user to choose a webcam and microphone based on data from the names array in Camera/Microphone, but I can't seem to get output visualized from the devices unless AudioPublisher and WebCamPublisher are actively publishing. Is this designed behavior? I don't want users to have to transmit during testing of input devices. Many thanks in advance for suggestions!

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Hi there,

Just making sure I understand correctly - you're trying to get the output

from the Microphone, before publishing, like, say a sound bar? ConnectNow

(which uses the LCCS components) has this feature, so it should be able to

work....

Are you calling Microphone.setLoopBack(true) in order to capture local

sound? Here's what I see in ConnectNow (some comments original, some mine) :

// _mm is the MicrophoneManager, and _comboBox has Microphone.names in it..

_mm.micIndex = _comboBox.selectedIndex;

// damned if I know why you need to check this

if(!_mm.inUse)

{

_mm.selectedMic.setLoopBack(true); //Loop back so we can see activity

}

_mm.selectedMic.soundTransform = new SoundTransform(0); //Silence it!

// then, in a timer loop, we have this :

private function updateActivity(p_evt:TimerEvent):void

{

// inputMeter is some kinda fancy progressbar

inputMeter.setProgress((mm.selectedMic) ?

_mm.selectedMic.activityLevel : 0, 100 );

}

Hope that helps,

nigel

View solution in original post

2 Replies

Avatar

Correct answer by
Former Community Member

Hi there,

Just making sure I understand correctly - you're trying to get the output

from the Microphone, before publishing, like, say a sound bar? ConnectNow

(which uses the LCCS components) has this feature, so it should be able to

work....

Are you calling Microphone.setLoopBack(true) in order to capture local

sound? Here's what I see in ConnectNow (some comments original, some mine) :

// _mm is the MicrophoneManager, and _comboBox has Microphone.names in it..

_mm.micIndex = _comboBox.selectedIndex;

// damned if I know why you need to check this

if(!_mm.inUse)

{

_mm.selectedMic.setLoopBack(true); //Loop back so we can see activity

}

_mm.selectedMic.soundTransform = new SoundTransform(0); //Silence it!

// then, in a timer loop, we have this :

private function updateActivity(p_evt:TimerEvent):void

{

// inputMeter is some kinda fancy progressbar

inputMeter.setProgress((mm.selectedMic) ?

_mm.selectedMic.activityLevel : 0, 100 );

}

Hope that helps,

nigel

Avatar

Level 2

Thanks, Nigel! That's exactly what I was looking for. Makes sense that the inUse property would let you know if the camera or microphone is already bound to something else. Thanks again!

-Robert

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----