Class AudioComponent
Support for Vector’s speakers
Vector's speakers can be used for playing user-provided audio. You can use the PlayStream(Stream, UInt32, UInt32) method to play a stream of 16bit mono audio data.
Implements
Inherited Members
Namespace: Anki.Vector
Assembly: Anki.Vector.dll
Syntax
public class AudioComponent : Component, INotifyPropertyChanged
Fields
| Improve this Doc View SourceMaxRobotAudioChunkSize
The maximum robot audio chunk size
public const int MaxRobotAudioChunkSize = 1024
Field Type
Int32 |
Properties
| Improve this Doc View SourceIsPlaybackActive
Gets a value indicating whether vector is currently playing back audio
public bool IsPlaybackActive { get; }
Property Type
Boolean |
Methods
| Improve this Doc View SourceCancelPlayback()
Cancels the audio playback
public Task CancelPlayback()
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous operation. |
PlayStream(Stream, UInt32, UInt32)
Plays audio using Vector's speakers.
public Task<PlaybackResult> PlayStream(Stream stream, uint frameRate, uint volume = 50U)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | 16bit audio byte stream containing 1 channel. |
UInt32 | frameRate | The frame rate between 8000-16025 hz. |
UInt32 | volume | The audio playback volume level (0-100). |
Returns
Type | Description |
---|---|
Task<PlaybackResult> | A task that represents the asynchronous operation; the task result contains the result from the robot. |
SetMasterVolume(MasterVolumeLevel)
Sets the master volume.
Note that muting the robot is not supported from the SDK.
public Task<StatusCode> SetMasterVolume(MasterVolumeLevel volumeLevel)
Parameters
Type | Name | Description |
---|---|---|
MasterVolumeLevel | volumeLevel | The volume level. |
Returns
Type | Description |
---|---|
Task<StatusCode> | A task that represents the asynchronous operation; the task result contains the result from the robot. |