.NET SDK Documentation

    Show / Hide Table of Contents

    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.

    Inheritance
    Object
    RobotObject
    Component
    AudioComponent
    Implements
    INotifyPropertyChanged
    Inherited Members
    RobotObject.PropertyChanged
    Namespace: Anki.Vector
    Assembly: Anki.Vector.dll
    Syntax
    public class AudioComponent : Component, INotifyPropertyChanged

    Fields

    | Improve this Doc View Source

    MaxRobotAudioChunkSize

    The maximum robot audio chunk size

    public const int MaxRobotAudioChunkSize = 1024
    Field Type
    Int32

    Properties

    | Improve this Doc View Source

    IsPlaybackActive

    Gets a value indicating whether vector is currently playing back audio

    public bool IsPlaybackActive { get; }
    Property Type
    Boolean

    Methods

    | Improve this Doc View Source

    CancelPlayback()

    Cancels the audio playback

    public Task CancelPlayback()
    Returns
    Type Description
    Task

    A task that represents the asynchronous operation.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    Implements

    System.ComponentModel.INotifyPropertyChanged
    • Improve this Doc
    • View Source
    Back to top Copyright (c) 2019 by Wayne Venables