Implementation of IAudioManager. Start point for interacting with Deepsy Audio service More...

Inheritance diagram for AudioManager:

Public Member Functions

 AudioManager (string ip)
 
 AudioManager (AudioDealerConfiguration dealer, AudioSubscriberConfiguration subscriber)
 
 AudioManager (int routePort, int publishPort)
 
IAudioConnection CreateConnection (string Id, IAudioPort origin, IAudioPort destination)
 Create an audio connection between two ports More...
 
IAudioConnection CreateConnection (string Id, IAudioPort origin, IAudioPort destination, int Priority)
 Create an audio connection between two ports More...
 
IAudioConnection CreateConnection (string Id, IAudioPort origin, IAudioPort destination, int Priority, int volume, int gain)
 Create an audio connection between two ports More...
 
IAudioPort CreatePort (string clientName, AudioPortType.Type type)
 Creates a user audio port More...
 
IEnumerable< IAudioConnectionGetConnections ()
 Returns the list of connections More...
 
IEnumerable< IAudioPortGetPorts ()
 Return the list of available ports More...
 
IAudioTask Play (IAudioPort port, string audioPath)
 
IAudioTask Record (IAudioPort port, string audioPath)
 
void RemoveConnection (IAudioConnection connection)
 Remove audio connection More...
 
void RemovePort (IAudioPort port)
 Removes a port More...
 
void StopTask (IAudioTask task)
 Stop task More...
 
IAudioTask Play (IAudioPort port, string audioPath, IEnumerable< IAudioConfiguration > configurations)
 Play audio in a port using a specific configuration More...
 
IAudioTask Record (IAudioPort port, string audioPath, IEnumerable< IAudioConfiguration > configurations)
 Record audio form a port to a file using specific configuration More...
 
IAudioTask GetTaskStatus (int taskId)
 returns task information More...
 
IEnumerable< IAudioTaskGetAllTaskInfo ()
 returns all task information More...
 
IEnumerable< IAudioConfigurationGetConfiguration ()
 Get Audio configurations More...
 
void SetConfiguration (IAudioConfiguration configuration)
 Set default Audio configurations More...
 
void SetPortGpio (IAudioPortGpio portGpio)
 Sets a GPO to be used as sink for audio port More...
 
void UnsetPortGpio (IAudioPort port)
 Releases an audio port from GPO More...
 
IEnumerable< IAudioPortGpioGetPortGpio ()
 Gets a IEnumerable with all GPO used as sinks for audio ports More...
 
override void Dispose ()
 

Public Attributes

const int MAX_PRIORITY_VALUE = 100
 Max allowed value for connection priority.
 
const int MIN_PRIORITY_VALUE = 0
 Min allowed value for connection priority.
 
const int DEFAULT_PRIORITY_VALUE = 0
 Default value for connection priority if not defined.
 
const int DEFAULT_VOLUME = -1
 Default value for connection volume if not defined.
 
const int DEFAULT_GAIN = -1
 Default value for connection gain if not defined.
 
- Public Attributes inherited from DeepsyDisposable
bool IsDiposed => Disposed
 

Protected Member Functions

override void Dispose (bool disposing)
 

Properties

EventHandler< IAudioPortListEventPortListEvent
 
EventHandler< IAudioConnectionListEventConnectionListEvent
 
EventHandler< IAudioPortGpioEventPortGpioEvent
 

Additional Inherited Members

- Protected Attributes inherited from DeepsyDisposable
bool Disposed = false
 
- Events inherited from IAudioNotifier
EventHandler< IAudioPortListEventPortListEvent
 Event raised by port changes More...
 
EventHandler< IAudioConnectionListEventConnectionListEvent
 Event raised by list of connection changes More...
 
EventHandler< IAudioPortGpioEventPortGpioEvent
 Event raised by port gpio changes More...
 

Detailed Description

Member Function Documentation

IAudioConnection CreateConnection ( string  Id,
IAudioPort  origin,
IAudioPort  destination 
)
Parameters
IdId of the new connection
originAudioPort origin of the new connection
destinationAudioPort destination of the new connection
Returns
Connection created
Exceptions
NotAvailableException (NOT_AVAILABLE)Thrown when service is not available
NotAvailableException (DPY_TIMEOUT)Thrown when service don't respond in time
HalExceptionThrown when service returns an error

Implements IAudioManager.

IAudioConnection CreateConnection ( string  Id,
IAudioPort  origin,
IAudioPort  destination,
int  Priority 
)
Parameters
IdId of the new connection
originAudioPort origin of the new connection
destinationAudioPort destination of the new connection
PriorityPriority of the new connection
Returns
Connection created
Exceptions
DeepsyHalException (NOT_AVAILABLE)Thrown when service is not available
DeepsyHalException (DPY_TIMEOUT)Thrown when service don't respond in time
DeepsyHalExceptionThrown when service returns an error

Implements IAudioManager.

IAudioConnection CreateConnection ( string  Id,
IAudioPort  origin,
IAudioPort  destination,
int  Priority,
int  volume,
int  gain 
)
Parameters
IdId of the new connection
originAudioPort origin of the new connection
destinationAudioPort destination of the new connection
PriorityPriority of the new connection
volumeVolume of the new connection
gainGain of the new connection
Returns
Connection created
Exceptions
DeepsyHalException (NOT_AVAILABLE)Thrown when service is not available
DeepsyHalException (DPY_TIMEOUT)Thrown when service don't respond in time
DeepsyHalExceptionThrown when service returns an error

Implements IAudioManager.

IAudioPort CreatePort ( string  clientName,
AudioPortType.Type  type 
)
Parameters
clientNameclient Name. It must start with user
typePort type (input / ouput)
Returns
Port created
Exceptions
NotAvailableException (NOT_AVAILABLE)Thrown when service is not available
NotAvailableException (DPY_TIMEOUT)Thrown when service don't respond in time
HalExceptionThrown when service returns an error

Implements IAudioManager.

IEnumerable<IAudioTask> GetAllTaskInfo ( )
Returns
List with task and its information
Exceptions
NotAvailableException (NOT_AVAILABLE)Thrown when service is not available
NotAvailableException (DPY_TIMEOUT)Thrown when service don't respond in time
HalExceptionThrown when service returns an error

Implements IAudioManager.

IEnumerable<IAudioConfiguration> GetConfiguration ( )
Returns
List with default confiturations
Exceptions
NotAvailableException (NOT_AVAILABLE)Thrown when service is not available
NotAvailableException (DPY_TIMEOUT)Thrown when service don't respond in time
HalExceptionThrown when service returns an error

Implements IAudioManager.

IEnumerable<IAudioConnection> GetConnections ( )
Returns
IConnection enumerable
Exceptions
NotAvailableException (NOT_AVAILABLE)Thrown when service is not available
NotAvailableException (DPY_TIMEOUT)Thrown when service don't respond in time
HalExceptionThrown when service returns an error

Implements IAudioManager.

IEnumerable<IAudioPortGpio> GetPortGpio ( )
Exceptions
DeepsyHalException (NOT_AVAILABLE)Thrown when service is not available
DeepsyHalException (DPY_TIMEOUT)Thrown when service don't respond in time
DeepsyHalExceptionThrown when service returns an error

Implements IAudioManager.

IEnumerable<IAudioPort> GetPorts ( )
Returns
IPort enumerable
Exceptions
NotAvailableException (NOT_AVAILABLE)Thrown when service is not available
NotAvailableException (DPY_TIMEOUT)Thrown when service don't respond in time
HalExceptionThrown when service returns an error

Implements IAudioManager.

IAudioTask GetTaskStatus ( int  taskId)
Parameters
taskIdTask ID
Returns
Task information
Exceptions
NotAvailableException (NOT_AVAILABLE)Thrown when service is not available
NotAvailableException (DPY_TIMEOUT)Thrown when service don't respond in time
HalExceptionThrown when service returns an error

Implements IAudioManager.

IAudioTask Play ( IAudioPort  port,
string  audioPath,
IEnumerable< IAudioConfiguration configurations 
)
Parameters
port
audioPathurl of the file to play
configurationsconfiguration for the task
Exceptions
NotAvailableException (NOT_AVAILABLE)Thrown when service is not available
NotAvailableException (DPY_TIMEOUT)Thrown when service don't respond in time
HalExceptionThrown when service returns an error
Returns

Implements IAudioManager.

IAudioTask Record ( IAudioPort  port,
string  audioPath,
IEnumerable< IAudioConfiguration configurations 
)
Parameters
port
audioPath
Returns
Exceptions
NotAvailableException (NOT_AVAILABLE)Thrown when service is not available
NotAvailableException (DPY_TIMEOUT)Thrown when service don't respond in time
HalExceptionThrown when service returns an error

Implements IAudioManager.

void RemoveConnection ( IAudioConnection  connection)
Parameters
connectionConnection to be removed
Exceptions
NotAvailableException (NOT_AVAILABLE)Thrown when service is not available
NotAvailableException (DPY_TIMEOUT)Thrown when service don't respond in time
HalExceptionThrown when service returns an error

Implements IAudioManager.

void RemovePort ( IAudioPort  port)
Parameters
portPort to be deleted
Exceptions
NotAvailableException (NOT_AVAILABLE)Thrown when service is not available
NotAvailableException (DPY_TIMEOUT)Thrown when service don't respond in time
HalExceptionThrown when service returns an error

Implements IAudioManager.

void SetConfiguration ( IAudioConfiguration  configuration)
Parameters
configurationconfiguration to be set
Returns
List with default confiturations
Exceptions
NotAvailableException (NOT_AVAILABLE)Thrown when service is not available
NotAvailableException (DPY_TIMEOUT)Thrown when service don't respond in time
HalExceptionThrown when service returns an error

Implements IAudioManager.

void SetPortGpio ( IAudioPortGpio  portGpio)
Parameters
portGpioAudioPortGpio port to set GPIO
Exceptions
DeepsyHalException (NOT_AVAILABLE)Thrown when service is not available
DeepsyHalException (DPY_TIMEOUT)Thrown when service don't respond in time
DeepsyHalExceptionThrown when service returns an error

Implements IAudioManager.

void StopTask ( IAudioTask  task)
Parameters
task
Exceptions
NotAvailableException (NOT_AVAILABLE)Thrown when service is not available
NotAvailableException (DPY_TIMEOUT)Thrown when service don't respond in time
HalExceptionThrown when service returns an error

Implements IAudioManager.

void UnsetPortGpio ( IAudioPort  port)
Parameters
portAudioPort port to to be released from GPO
Exceptions
DeepsyHalException (NOT_AVAILABLE)Thrown when service is not available
DeepsyHalException (DPY_TIMEOUT)Thrown when service don't respond in time
DeepsyHalExceptionThrown when service returns an error

Implements IAudioManager.