Skip to content

outputAudio #25

Description

@alanstyong71

Hi,

Not sure who's maintaining the repo on this. I'm sure this is a pretty popular request.

But one suggestion is to include the outputAudio in the AIResponse class:

class OutputAudio {
  ByteData _outputAudio;
...

}

class AIResponse {
  String _responseId;
  QueryResult _queryResult;
  num _intentDetectionConfidence;
  String _languageCode;
  DiagnosticInfo _diagnosticInfo;
  WebhookStatus _webhookStatus;
  OutputAudio _outputAudio; // define and add OutputAudio class

  AIResponse({Map body}) {
   // add this
   _outputAudio = body['outputAudio'];
  
    _responseId = body['responseId'];
    _intentDetectionConfidence = body['intentDetectionConfidence'];
    _queryResult = new QueryResult(body['queryResult']);
    _languageCode = body['languageCode'];
    _diagnosticInfo = (body['diagnosticInfo'] != null
        ? new DiagnosticInfo(body['diagnosticInfo'])
        : null);
    _webhookStatus = body['webhookStatus'] != null
        ? new WebhookStatus(body['webhookStatus'])
        : null;
  }"

// and finally, add one getter:

OutputAudio get outputAudio {
    return _outputAudio;
  }

You can then choose to use any audio player on the output audio.

Just a suggestion.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions