Packagecom.adobe.rtc.collaboration
Classpublic class AudioPublisher
InheritanceAudioPublisher Inheritance mx.core.UIComponent
ImplementsISessionSubscriber

AudioPublisher is the collaboration component responsible for publishing VOIP audio to others in the room. It acts as an intermediary between the Microphone/NetStream and StreamManager and is responsible for publishing audio StreamDescriptors to the StreamManager, so that AudioSubscribers in the room are aware a new stream has been initiated.

In order to improve workflow, it provides an API through which to request other users to begin publishing their audio (publish with an optional parameter). It also listens for remote requests for the user to begin publishing and prompts the user to begin when needed. The AudioPublisher has no user interface of its own, but it does provide a basic API through which any commands concerning publishing VOIP audio should be routed.

Like all stream components, AudioPublisher has an API for setting and getting a groupName. This property can be used to create multiple VOIP groups, each being separate and having different access/publish models, allowing for multiple private conversations. For a subscriber to listen to a particular VOIP stream from a publisher, both should have the same assigned groupName. If no groupName is assigned, the publisher defaults to publishing into the public group.

By default, only users with the role UserRoles.PUBLISHER or greater may publish audio, and all users with role of greater than UserRoles.VIEWER are able to subscribe to these streams.

Starting and stopping VOIP audio in a room
  <rtc:AdobeHSAuthenticator 
     // Deployed applications DO NOT hard code username and password here.
     userName="AdobeIDusername@example.com" 
     password="AdobeIDpassword" 
     id="auth"/> 
   <session:ConnectSessionContainer 
     roomURL="http://connect.acrobat.com/exampleAccount/exampleRoom" 
     authenticator="{auth}">
     <mx:VBox>
        <collaboration:AudioPublisher id="audioPub"/>
        <collaboration:AudioSubscriber/>
         <mx:Button label="Audio" toggle="true" id="audioButt" 
    click="(audioButt.selected) ? audioPub.publish() : audioPub.stop()"/>
     </mx:VBox>
   </session:ConnectSessionContainer>
  

See also

com.adobe.rtc.collaboration.AudioSubscriber
com.adobe.rtc.sharedManagers.StreamManager
com.adobe.rtc.sharedManagers.descriptors.StreamDescriptor


Public Properties
 PropertyDefined by
  accessModel : int
The role value required for access to audio streams for this component's group.
AudioPublisher
  connectSession : IConnectSession
The IConnectSession with which this component is associated; it defaults to the first IConnectSession created in the application.
AudioPublisher
  gain : Number
The microphone gain that is the amount by which the microphone should multiply the signal before transmitting it.
AudioPublisher
  groupName : String
Components (pods) are assigned to a group via groupName; if not specified, the component is assigned to the default, public group (the room at large).
AudioPublisher
  isPaused : Boolean
[read-only] Returns true if my audio is muted; false if not or audio is not there.
AudioPublisher
  isPublishing : Boolean
[read-only] Returns true if my audio is publishing; false if not.
AudioPublisher
  isSynchronized : Boolean
[read-only] Returns whether or not the component is synchronized
AudioPublisher
  microphone : Microphone
[read-only] Returns the Microphone object associated with this publisher.
AudioPublisher
  publishModel : int
The role required for this component to publish to the group specified by groupName.
AudioPublisher
  sharedID : String
Defines the logical location of the component on the service; typically this assigns the sharedID of the collectionNode used by the component.
AudioPublisher
  silenceLevel : Number
Sets the silence level of the microphone associated with this publisher.
AudioPublisher
  silenceTimeout : int
Sets the silence timeout of the microphone associated with this publisher.
AudioPublisher
  useEchoSuppression : Boolean
true if echo suppression is enabled; false otherwise.
AudioPublisher
Public Methods
 MethodDefined by
  
Constructor
AudioPublisher
  
close():void
Disposes all listeners to the network and framework classes, and its use is recommended for proper garbage collection of the component.
AudioPublisher
  
Gets the NodeConfiguration on a specific audio stream group.
AudioPublisher
  
getUserRole(p_userID:String):int
Returns the role of a given user for audio streams within this component's group.
AudioPublisher
  
pause(p_mute:Boolean = false, p_publisherID:String = null):void
Mutes or unmutes the the VOIP stream of the specified user (or the current user if not specified).
AudioPublisher
  
publish(p_publisherID:String = null):void
publish() causes the current user or the user specified by p_publisherID (if non-null) to be prompted to publish VOIP.
AudioPublisher
  
setNodeConfiguration(p_nodeConfiguration:NodeConfiguration):void
Sets the NodeConfiguration.
AudioPublisher
  
setUserRole(p_userID:String, p_userRole:int):void
Sets the role of a given user for publishing to the component's group specified by groupName.
AudioPublisher
  
stop(p_publisherID:String = null):void
Stops publishing the audio VOIP stream for the specified user; if null, it defaults to the current user.
AudioPublisher
  
subscribe():void
Tells the component to begin synchronizing with the service.
AudioPublisher
Events
 EventSummaryDefined by
   Dispatched when the current user's echo suppression is changed.AudioPublisher
   Dispatched when the current user's gain is changed.AudioPublisher
   Dispatched when whether a user is publishing his audio or not changes AudioPublisher
   Dispatched when the current user's silence level is changed.AudioPublisher
   Dispatched when the current user's audio stream stops publishing.AudioPublisher
   Dispatched when the current user's audio stream is muted.AudioPublisher
   Dispatched when the current user is publishing or not AudioPublisher
   Dispatched when the current user's audio stream is about to be published by the component.AudioPublisher
   Dispatched when the component either loses its connection to the session or regains it and has finished re-synchronizing itself to the rest of the room.AudioPublisher
   Dispatched when the user's role with respect to the component changes.AudioPublisher
Property detail
accessModelproperty
accessModel:int  [read-write]

The role value required for access to audio streams for this component's group.

Implementation
    public function get accessModel():int
    public function set accessModel(value:int):void
connectSessionproperty 
connectSession:IConnectSession  [read-write]

The IConnectSession with which this component is associated; it defaults to the first IConnectSession created in the application. Note that this may only be set once before subscribe() is called, and re-sessioning of components is not supported.

Implementation
    public function get connectSession():IConnectSession
    public function set connectSession(value:IConnectSession):void
gainproperty 
gain:Number  [read-write]

The microphone gain that is the amount by which the microphone should multiply the signal before transmitting it.

This property can be used as the source for data binding.

Implementation
    public function get gain():Number
    public function set gain(value:Number):void
groupNameproperty 
groupName:String  [read-write]

Components (pods) are assigned to a group via groupName; if not specified, the component is assigned to the default, public group (the room at large). Groups are like separate conversations within the room, but each conversation could employ one or more pods; for example, one "conversation" may use a web camera, chat, and whiteboard pod, with each pod using different access and publish models. Users are members of and can only see components within the group they are assigned. Room hosts can see all the groups and all the members in those groups.

Implementation
    public function get groupName():String
    public function set groupName(value:String):void
isPausedproperty 
isPaused:Boolean  [read-only]

Returns true if my audio is muted; false if not or audio is not there.

This property can be used as the source for data binding.

Implementation
    public function get isPaused():Boolean
isPublishingproperty 
isPublishing:Boolean  [read-only]

Returns true if my audio is publishing; false if not.

This property can be used as the source for data binding.

Implementation
    public function get isPublishing():Boolean
isSynchronizedproperty 
isSynchronized:Boolean  [read-only]

Returns whether or not the component is synchronized

This property can be used as the source for data binding.

Implementation
    public function get isSynchronized():Boolean
microphoneproperty 
microphone:Microphone  [read-only]

Returns the Microphone object associated with this publisher.

Implementation
    public function get microphone():Microphone
publishModelproperty 
publishModel:int  [read-write]

The role required for this component to publish to the group specified by groupName.

Implementation
    public function get publishModel():int
    public function set publishModel(value:int):void
sharedIDproperty 
sharedID:String  [read-write]

Defines the logical location of the component on the service; typically this assigns the sharedID of the collectionNode used by the component. sharedIDs should be unique within a room if they're expressing two unique locations. Note that this can only be assigned once before subscribe() is called. For components with an id property, sharedID defaults to that value.

Implementation
    public function get sharedID():String
    public function set sharedID(value:String):void
silenceLevelproperty 
silenceLevel:Number  [read-write]

Sets the silence level of the microphone associated with this publisher.

This property can be used as the source for data binding.

Implementation
    public function get silenceLevel():Number
    public function set silenceLevel(value:Number):void
silenceTimeoutproperty 
silenceTimeout:int  [read-write]

Sets the silence timeout of the microphone associated with this publisher.

Implementation
    public function get silenceTimeout():int
    public function set silenceTimeout(value:int):void
useEchoSuppressionproperty 
useEchoSuppression:Boolean  [read-write]

true if echo suppression is enabled; false otherwise.

This property can be used as the source for data binding.

Implementation
    public function get useEchoSuppression():Boolean
    public function set useEchoSuppression(value:Boolean):void
Constructor detail
AudioPublisher()constructor
public function AudioPublisher()

Constructor

Method detail
close()method
public function close():void

Disposes all listeners to the network and framework classes, and its use is recommended for proper garbage collection of the component.

getNodeConfiguration()method 
public function getNodeConfiguration():NodeConfiguration

Gets the NodeConfiguration on a specific audio stream group.

Returns
NodeConfiguration
getUserRole()method 
public function getUserRole(p_userID:String):int

Returns the role of a given user for audio streams within this component's group.

Parameters
p_userID:String — The user ID of the user whose role we should get.

Returns
int
pause()method 
public function pause(p_mute:Boolean = false, p_publisherID:String = null):void

Mutes or unmutes the the VOIP stream of the specified user (or the current user if not specified). Notifies all users in the room that the stream has been muted or unmuted.

Parameters
p_mute:Boolean (default = false) — True to mute the audio; false to unmute.
 
p_publisherID:String (default = null) — If null, the current user's audio. If non-null, and the current user is an owner, the parameter forces the specified user to mute their stream.
publish()method 
public function publish(p_publisherID:String = null):void

publish() causes the current user or the user specified by p_publisherID (if non-null) to be prompted to publish VOIP. If the user accepts, it notifies other users through the StreamManager of the new audio stream, and begins streaming VOIP into the room for consumption by participating AudioSubscribers.

Parameters
p_publisherID:String (default = null) — Defaults to null and therefore the current user. If non-null, the parameter requests the specified user to begin. Note that only a user with role of owner may request others to publish.

See also

setNodeConfiguration()method 
public function setNodeConfiguration(p_nodeConfiguration:NodeConfiguration):void

Sets the NodeConfiguration.

Parameters
p_nodeConfiguration:NodeConfiguration — The node Configuration of the group of Audio Stream.
setUserRole()method 
public function setUserRole(p_userID:String, p_userRole:int):void

Sets the role of a given user for publishing to the component's group specified by groupName.

Parameters
p_userID:String — The user ID of the user whose role should be set.
 
p_userRole:int — The role value to assign to the user with this user ID.
stop()method 
public function stop(p_publisherID:String = null):void

Stops publishing the audio VOIP stream for the specified user; if null, it defaults to the current user.

Parameters
p_publisherID:String (default = null) — The user ID of the user whose audio stream should be stopped. Defaults to the current user. Only an owner in the room can stop a remote user's stream.
subscribe()method 
public function subscribe():void

Tells the component to begin synchronizing with the service. For UIComponent-based components such as this one, this is called automatically upon being added to the displayList. For "headless" components, this method must be called explicitly.

Event detail
echoSuppressionChangedevent 
Event object type: com.adobe.rtc.events.AudioConfigurationEvent

Dispatched when the current user's echo suppression is changed.

gainChangedevent  
Event object type: com.adobe.rtc.events.AudioConfigurationEvent

Dispatched when the current user's gain is changed.

isAudioPublishingevent  
Event object type: flash.events.Event

Dispatched when whether a user is publishing his audio or not changes

silenceLevelChangedevent  
Event object type: com.adobe.rtc.events.AudioConfigurationEvent

Dispatched when the current user's silence level is changed.

streamDeleteevent  
Event object type: com.adobe.rtc.events.StreamEvent

Dispatched when the current user's audio stream stops publishing.

streamPauseevent  
Event object type: com.adobe.rtc.events.StreamEvent

Dispatched when the current user's audio stream is muted.

streamPublishingevent  
Event object type: com.adobe.rtc.events.StreamEvent

Dispatched when the current user is publishing or not

streamReceiveevent  
Event object type: com.adobe.rtc.events.StreamEvent

Dispatched when the current user's audio stream is about to be published by the component.

synchronizationChangeevent  
Event object type: com.adobe.rtc.events.CollectionNodeEvent

Dispatched when the component either loses its connection to the session or regains it and has finished re-synchronizing itself to the rest of the room.

userRoleChangeevent  
Event object type: com.adobe.rtc.events.CollectionNodeEvent

Dispatched when the user's role with respect to the component changes.





 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/labs/acrobatcom/com/adobe/rtc/collaboration/AudioPublisher.html