[COLOR=#000000][FONT=Arial]I am creating a project but I am having some issues , the project consists in 2 persons screaming on two microphones, and filling a bar with that scream. The problem is how can flash work with these two inputs simultaneous,this is the code.[/FONT][/COLOR]
[COLOR=#00008B]import[/COLOR] flash.events.[COLOR=#2B91AF]ActivityEvent[/COLOR];[COLOR=#00008B]import[/COLOR] flash.events.[COLOR=#2B91AF]StatusEvent[/COLOR];[COLOR=#00008B]import[/COLOR] flash.media.[COLOR=#2B91AF]Microphone[/COLOR][COLOR=#00008B]var[/COLOR] myTimer:[COLOR=#2B91AF]Timer[/COLOR] = [COLOR=#00008B]new[/COLOR] [COLOR=#2B91AF]Timer/COLOR;myTimer.addEventListener([COLOR=#2B91AF]TimerEvent[/COLOR].TIMER, onMicActivity);myTimer.start();[COLOR=#00008B]var[/COLOR] deviceArray:[COLOR=#2B91AF]Array[/COLOR] = [COLOR=#2B91AF]Microphone[/COLOR].names;[COLOR=#00008B]var[/COLOR] micaux = [COLOR=#800000]0[/COLOR];[COLOR=#00008B]var[/COLOR] micaux2 = [COLOR=#800000]0[/COLOR];trace([COLOR=#800000]“Available sound input devices:”[/COLOR]);[COLOR=#00008B]for[/COLOR] ([COLOR=#00008B]var[/COLOR] i:[COLOR=#00008B]int[/COLOR] = [COLOR=#800000]0[/COLOR]; i < deviceArray.length; i++){ trace([COLOR=#800000]" “[/COLOR] + deviceArray*+ [COLOR=#800000]” "[/COLOR] + i);}[COLOR=#00008B]var[/COLOR] mic:[COLOR=#2B91AF]Microphone[/COLOR] = [COLOR=#2B91AF]Microphone[/COLOR].getMicrophone();[COLOR=#00008B]var[/COLOR] mic2:[COLOR=#2B91AF]Microphone[/COLOR] = [COLOR=#2B91AF]Microphone[/COLOR].getMicrophone([COLOR=#800000]1[/COLOR]);trace([COLOR=#800000]"mic1 "[/COLOR]+mic.name);trace([COLOR=#800000]"mic2 "[/COLOR]+mic2.name);mic.gain = [COLOR=#800000]60[/COLOR];mic.rate = [COLOR=#800000]11[/COLOR];mic.setUseEchoSuppression([COLOR=#00008B]true[/COLOR]);mic.setLoopBack([COLOR=#00008B]true[/COLOR]);mic.setSilenceLevel([COLOR=#800000]5[/COLOR], [COLOR=#800000]1000[/COLOR]);mic2.gain = [COLOR=#800000]60[/COLOR];mic2.rate = [COLOR=#800000]11[/COLOR];mic2.setUseEchoSuppression([COLOR=#00008B]true[/COLOR]);mic2.setLoopBack([COLOR=#00008B]true[/COLOR]);mic2.setSilenceLevel([COLOR=#800000]5[/COLOR], [COLOR=#800000]1000[/COLOR]);[COLOR=#00008B]function[/COLOR] onMicActivity(event:[COLOR=#2B91AF]TimerEvent[/COLOR]):[COLOR=#00008B]void[/COLOR]{ [COLOR=gray]//trace(“activating=” + “, activityLevel=” + [/COLOR] [COLOR=gray]// mic.activityLevel);[/COLOR] [COLOR=#00008B]if[/COLOR] (mic.activityLevel > [COLOR=#800000]3[/COLOR]) { micaux = micaux + mic.activityLevel; } [COLOR=#00008B]if[/COLOR] (mic2.activityLevel >[COLOR=#800000]3[/COLOR]){ micaux2 = micaux2 + mic2.activityLevel; } trace([COLOR=#800000]"mic1 "[/COLOR] +mic.activityLevel); trace([COLOR=#800000]“mic 2”[/COLOR] +mic2.activityLevel); [COLOR=#00008B]if[/COLOR] (micaux>[COLOR=#800000]0[/COLOR]){ soundbox.text = [COLOR=#2B91AF]String/COLOR; healthBar.barColor.x += mic.activityLevel / [COLOR=#800000]50[/COLOR]; healthBar.barColor.scaleX += mic.activityLevel / [COLOR=#800000]50[/COLOR];} [COLOR=#00008B]if[/COLOR] (micaux2>[COLOR=#800000]0[/COLOR]){ soundbox2.text = [COLOR=#2B91AF]String/COLOR; healthBar2.barColor.x += mic2.activityLevel / [COLOR=#800000]50[/COLOR]; healthBar2.barColor.scaleX += mic2.activityLevel / [COLOR=#800000]50[/COLOR]; }[COLOR=#000000][FONT=Arial]Soundbox is where appears the score of the user, and healthbar.barcolor is the bar being filled with that score, when i run this code it appear all ok, but only 1 microphone works when i open the settings of that swf the two work ok :[/FONT][/COLOR]
[COLOR=#000000][FONT=Arial]Hardware is being connected thru two different usb ports.[/FONT][/COLOR]
[COLOR=#000000][FONT=Arial]NETSTREAM didn’t solved[/FONT][/COLOR]
[COLOR=#000000][FONT=Arial]Thanks in advance[/FONT][/COLOR]