AudioPlayer Interface

2017. 5. 24. 16:25Architecture/A.I

반응형

Overview
AudioPlayer 인터페이스는 음성을 통해 오디오 재생을 제어하는 directive와 재생 진행을 관리하고 모니터링하는 event를 제공합니다. 
재생 컨트롤을 버튼 (물리적 또는 GUI)에 매핑하려는 경우 PlaybackController 인터페이스를 참조.
이 페이지는 다음과 같은 주제를 다룹니다.
  •   AudioPlayer State Diagram
  •   AudioPlayer directive 및 event

State Diagram
상태 다이어그램 다음 다이어그램은 AudioPlayer 구성 요소에 의해 구동되는 상태 변경을 보여줍니다. 
Boxes는 AudioPlayer 상태를 나타내며 Connectors는 상태 전환을 나타냅니다.








AudioPlayer의 상태는 다음과 같습니다.
IDLE : AudioPlayer는 제품의 전원을 처음 켜거나 재부팅 한 후 Play directive를 사용하기 전에 IDLE 상태에 있습니다.
PLAYING : 클라이언트가 오디오 스트림 재생을 시작하면 AudioPlayer는 IDLE 상태에서 PLAYING 상태로 전환해야합니다.
오디오 스트림 일시 중지 또는 중지, 클라이언트가 스트림 버퍼링에 문제가 있거나 재생에 실패한 경우 클라이언트에서 작업 수행을 지시하는 지시문을 받으면 작업이 수행 될 때 AudioPlayer가 적절한 상태로 전환되어야합니다. AVS에 이벤트 보내기). 그렇지 않으면 현재 스트림이 끝날 때까지 AudioPlayer가 재생 상태를 유지해야합니다.
또한 AudioPlayer는 다음과 같은 경우 재생 상태를 유지해야합니다.
  • AVS로 재생(playback) 진행보고
  • AVS에 stream metadata 보내기

STOPPED : AudioPlayer가 중지 된 상태로 전환해야하는 경우가 4 가지입니다. 
재생 상태에있는 동안 AudioPlayer는 다음과 같은 경우에 중지 상태로 전환해야합니다. 
1) 스트림에 문제가 발생하여 재생에 실패한 경우.
2) 클라이언트는 AVS로부터 Stop directive를 받을 경우. 
3) clearBehavior가 CLEAR_ALL 인 ClearQueue directive을 받을 경우. 
4) REPLACE_ALL의 playBehavior가있는 Play directive을 받을 경우.
paused 또는 buffer_underrun 상태에서 CLEAR_ALL에 대한 ClearQueue directive를 수신하면 AudioPlayer는 중지로 전환 해야함. AudioPlayer는 클라이언트가 Play directive를 받고 오디오 스트림 재생을 시작하고 AVS에 PlaybackStarted 이벤트를 보낼 때마다 중지에서 재생으로 전환해야합니다.

PAUSED : 우선 순위가 높은 입력 / 출력 (예 : 사용자 또는 Alexa 음성)을 수용하기 위해 콘텐츠 채널의 오디오가 일시 중지 된 경우 AudioPlayer가 일시 중지 상태로 전환해야합니다. 우선 순위가 지정된 작업이 완료되면 재생을 다시 시작해야합니다. 
오디오 입 / 출력의 우선 순위 지정에 대한 자세한 내용은 상호 작용 모델을 참조하십시오.

BUFFER_UNDERRUN : 클라이언트가 읽히는 것보다 느리게 데이터를 제공받을 때, AudioPlayer는 buffer_underrun 상태로 전환해야합니다. 
AudioPlayer는 버퍼가 재생을 다시 시작할 정도로 충분히 찰 때까지이 상태를 유지해야하며, 이 시점에서 재생 상태로 돌아와야합니다.

FINISHED : 스트림 재생이 끝나면 AudioPlayer가 완료 상태로 전환해야합니다. 이것은 재생 대기열의 모든 스트림에 해당됩니다. 
재생 대기열이 대기중인 경우에도 클라이언트는 AVS에 PlaybackFinished event를 보내야하며, 이후에 각 스트림의 재생이 끝나면 재생 상태에서 종료되도록 완료해야합니다.

AudioPlayer는 다음과 같은 경우 완료에서 재생으로 전환해야합니다.
  • 클라이언트는 Play directive를 받습니다.
  • 재생 대기열의 next stream이 재생을 시작합니다 (PlaybackStarted event 다음).



Play Directive
Play directive는 클라이언트로 보내 오디오 재생을 시작합니다. 
JSON directive와 최대 하나의 오디오 스트림 또는 바이너리 오디오 첨부 파일로 구성된 멀티 파트 메시지입니다.

directive의 payload에 포함 된 playBehavior 매개 변수를 사용하여 클라이언트가 스트림의 대기열 처리 및 재생을 처리하는 방법을 결정할 수 있습니다. 
허용 된 값은 취해야 할 조치에 대한 힌트를 제공합니다.
REPLACE_ALL :  Play 지시어로 반환 된 스트림의 재생을 즉시 시작하고 현재 스트림과 대기열에 포함 된 스트림을 바꿉니다. 
                             스트림이 재생 중이고 REPLACE_ALL의 playBehavior로 Play 지시문을 받으면 AVS에 PlaybackStopped 이벤트를     
                             보내야합니다.
ENQUEUE : 스트림을 현재 큐 끝에 추가합니다.
REPLACE_ENQUEUED : 대기열의 모든 스트림을 바꿉니다. 현재 재생중인 스트림에는 영향을주지 않습니다.

NOTE.
재생 대기열에 스트림을 추가 할 때 활성 스트림의 토큰이 대기열에 추가되는 스트림의 expectedPreviousToken과 일치하는지 확인해야합니다. 토큰이 일치하지 않으면 스트림을 무시해야합니다. 그러나 expectedPreviousToken이 반환되지 않으면 스트림을 큐에 추가해야합니다.


Sample Message

{
    "directive": {
        "header": {
            "namespace": "AudioPlayer",
            "name": "Play",
            "messageId": "{{STRING}}",
            "dialogRequestId": "{{STRING}}"
        },
        "payload": {
            "playBehavior": "{{STRING}}",
            "audioItem": {
                "audioItemId": "{{STRING}}",
                "stream": {
                        "url": "{{STRING}}",
                        "streamFormat" "AUDIO_MPEG"
                        "offsetInMilliseconds": {{LONG}},
                        "expiryTime": "{{STRING}}",
                        "progressReport": {
                            "progressReportDelayInMilliseconds": {{LONG}},
                            "progressReportIntervalInMilliseconds": {{LONG}}
                        },
                        "token": "{{STRING}}",
                        "expectedPreviousToken": "{{STRING}}"
                }
            }
        }
    }
}


Binary Audio Attachment
Play directive에는 멀티 파트 메시지의 일부로 해당 이진 오디오 첨부 파일이있을 수 있습니다. 
바이너리 오디오 첨부 파일이 있으면 url에 제공된 값에 다음 접두사 cid가 포함됩니다.

다음 멀티 파트 헤더가 바이너리 오디오 첨부 파일 앞에옵니다.
Content-Type : application/octet-stream
Content-ID : {{Audio Item CID}}
{{BINARY AUDIO ATTACHMENT}}

Header Parameters

Parameter
Description
Type
messageId
특정 메시지를 나타내는 데 사용되는 고유 ID입니다.
string
dialogRequestId
특정 Recognize event에 응답하여 전송 된 directive를 상호 연관시키는 데 사용되는 고유 ID입니다.

Note: dialogRequestId는 음성 요청에 대한 응답으로 만 전송됩니다. dialogRequestId는 downchannel stream에서 클라이언트로 전송 된 directive에 포함되어 있지 않습니다.
string


Payload Parameters
중요 : 귀하의 클라이언트는 Play에서 지원하는 모든 payload 매개 변수를 수용하고 작동하도록 설계되어야하며 
JSON의 키 / 값 쌍이 누락 되어도 중단되어서는 안됩니다.
Parameter
Description
Type
playBehavior
재생 힌트를 제공합니다. 허용되는 값 :  REPLACE_ALL, ENQUEUE, REPLACE_ENQUEUED. 
  • REPLACE_ALLPlay Directive로 반환 된 스트림의 재생을 즉시 시작하고 현재 스트림과 대기열에 포함 된 스트림을 바꿉니다.
  • ENQUEUE현재의 큐의 마지막에 스트림을 추가합니다.
  • REPLACE_ENQUEUED큐의 모든 스트림을 바꿉니다. 현재 재생중인 스트림에는 영향을주지 않습니다.
string
audioItem
audioItem의 키 / 값 쌍을 포함합니다.
object
audioItem.audioItemId
audioItem을 식별합니다.
string
audioItem.stream
stream의 키 / 값 쌍을 포함합니다.
object
audioItem.stream.url
오디오 내용의 위치를 식별합니다. 
오디오 콘텐츠가 이진 오디오 첨부 파일 인 경우이 값은 콘텐츠의 고유 식별자이며 "cid :"와 같이 형식이 지정됩니다. 그렇지 않으면 값은 원격 http / https 위치가됩니다.
string
audioItem.stream.streamFormat
play directive에 연결된 바이너리 오디오 첨부 파일이 있으면 streamFormat이 payload에 포함됩니다. 연결된 오디오가 스트림이면이 매개 변수가 표시되지 않습니다.
Accepted Value: AUDIO_MPEG
string
audioItem.stream.offsetInMilliseconds
스트림에서 클라이언트가 재생을 시작해야하는 위치를 나타내는 타임 스탬프. 예를 들어, offsetInMilliseconds를 0으로 설정하면 스트림 재생이 0 또는 스트림 시작 부분에서 시작되어야 함을 나타냅니다. 다른 값은 재생이 제공된 오프셋에서 시작해야 함을 나타냅니다.
long
audioItem.stream.expiryTime
스트림이 유효하지 않은 경우의 ISO 8601 형식의 날짜와 시간.
string
audioItem.stream.progressReport
progress reports의 키 / 값 쌍을 포함합니다.
object
audioItem.stream.progressReport. progressReportDelayInMilliseconds
ProgressReportDelayElapsed 이벤트를 AVS로 보낼 시간 (밀리 초)을 지정합니다. ProgressReportDelayElapsed는 지정된 간격으로 한 번만 보내야합니다
참고 : 일부 음악 제공 업체는이 보고서를 요구하지 않습니다. 보고서가 필요하지 않은 경우에는 progressReportDelayInMilliseconds가 페이로드에 표시되지 않습니다.
long
audioItem.stream.progressReport. progressReportIntervalInMilliseconds
ProgressReportIntervalElapsed 이벤트를 AVS로 내보내는 시간을 밀리 초 단위로 지정합니다. ProgressReportIntervalElapsed는 지정된 간격으로 주기적으로 보내야합니다
참고 : 일부 음악 제공 업체는이 보고서를 요구하지 않습니다. 
보고서가 필요하지 않은 경우에는 progressReportIntervalInMilliseconds가 페이로드에 표시되지 않습니다.
long
audioItem.stream.token
현재의 스트림을 나타내는 opaque token 입니다.
string
audioItem.stream.
expectedPreviousToken
예상되는 이전 스트림을 나타내는 opaque token 입니다.
string


PlaybackStarted Event

클라이언트가 Play Directive를 처리하고 관련 오디오 스트림의 재생을 시작한 후에 PlaybackStarted 이벤트를 AVS로 보내야합니다.
 Note: AVS가 보내는 각 URL에 대해 하나 이상의 PlaybackStarted 이벤트가 필요합니다. 
여러 URL로 구성된 재생 목록 URL을 받으면 PlaybackStarted 이벤트를 하나만 보내십시오.

Sample Message

{
    "event": {
        "header": {
            "namespace": "AudioPlayer",
            "name": "PlaybackStarted",
            "messageId": "{{STRING}}"
        },
        "payload": {
            "token": "{{STRING}}",
            "offsetInMilliseconds": {{LONG}}
        }
    }
}

Header Parameters

Parameter
Description
Type
messageId
A unique ID used to represent a specific message.
string

Payload Parameters

Parameter
Description
Type
token
An opaque token provided by the Play directive.
string
offsetInMilliseconds
트랙의 현재 오프셋 (밀리 초)을 나타냅니다.
long

PlaybackNearlyFinished Event

클라이언트가 재생 대기열에서 next stream을 버퍼링 / 다운로드 할 준비가되면 PlaybackNearlyFinished 이벤트를 보내야합니다. 
클라이언트는 현재 재생중인 스트림에 대한 PlaybackStarted 이벤트 이후에만 해당 이벤트가 전송되도록해야합니다. 

Alexa는 다음 중 하나를 사용하여 해당 이벤트에 응답합니다.
  • next stream을 포함하는 Play Directive
  • HTTP 204 응답 코드

Sample Message
{
    "event": {
        "header": {
            "namespace": "AudioPlayer",
            "name": "PlaybackNearlyFinished",
            "messageId": "{{STRING}}"
        },
        "payload": {
            "token": "{{STRING}}",
            "offsetInMilliseconds": {{LONG}}
        }
    }
}

Header Parameters

Parameter
Description
Type
messageId
A unique ID used to represent a specific message.
string

Payload Parameters

Parameter
Description
Type
token
An opaque token provided by the Play directive.
string
offsetInMilliseconds
Identifies a track's current offset in milliseconds.
long


ProgressReportDelayElapsed Event

Play Directive에 progressReportDelayInMilliseconds가 있으면 ProgressReportDelayElapsed 이벤트를 AVS로 보내야합니다. 
이 이벤트는 offsetInMilliseconds가 아닌 스트림의 시작 부분에서 지정된 간격으로 한 번 보내야합니다. 
예를 들어, Play Directive에 progressReportDelayInMilliseconds 값이 20000 인 경우 ProgressReportDelayElapsed 이벤트는 
트랙 시작 부분에서 20,000 밀리 초가 지나야합니다. 그러나 Play Directive에 offsetInMilliseconds 값이 10000이고 progressReportDelayInMilliseconds 값이 20000이면 이벤트를 재생에 10,000 밀리 초씩 보내야합니다. 이는 진행 보고서가 재생 지시문의 오프셋이 아니라 스트림의 시작에서 전송되기 때문입니다

Sample Message

{
    "event": {
        "header": {
            "namespace": "AudioPlayer",
            "name": "ProgressReportDelayElapsed",
            "messageId": "{{STRING}}"
        },
        "payload": {
            "token": "{{STRING}}",
            "offsetInMilliseconds": {{LONG}}
        }
    }
}

Header Parameters

Parameter
Description
Type
messageId
A unique ID used to represent a specific message.
string

Payload Parameters

Parameter
Description
Type
token
An opaque token provided by the Play directive.
string
offsetInMilliseconds
Identifies a track's current offset in milliseconds.
long


ProgressReportIntervalElapsed Event


Play Directive에 progressReportIntervalInMilliseconds가 있으면 ProgressReportIntervalElapsed 이벤트를 AVS로 보내야합니다. 
이 이벤트는 offsetInMilliseconds가 아닌 스트림의 시작부터 지정된 간격으로 정기적으로 보내야합니다. 
예를 들어 Play 지시문에 progressReportIntervalInMilliseconds 값이 20000 인 경우 ProgressReportIntervalElapsed 이벤트는 트랙 시작부터 20,000 밀리 초 및 스트림이 끝날 때까지 20,000 밀리 초마다 보내야합니다. 그러나 Play Directive에 offsetInMilliseconds 값이 10000이고 progressReportIntervalInMilliseconds 값이 20000 인 경우 재생 시작부터 10,000 밀리 초, 스트림이 끝날 때까지 20,000 밀리 초마다 이벤트를 보내야합니다. 이는 지정된 간격이 재생 지시문의 오프셋이 아니라 스트림의 시작부터 있기 때문입니다.

Sample Message

{
    "event": {
        "header": {
            "namespace": "AudioPlayer",
            "name": "ProgressReportIntervalElapsed",
            "messageId": "{{STRING}}"
        },
        "payload": {
            "token": "{{STRING}}",
            "offsetInMilliseconds": {{LONG}}
        }
    }
}

Header Parameters

Parameter
Description
Type
messageId
A unique ID used to represent a specific message.
string

Payload Parameters

Parameter
Description
Type
token
An opaque token provided by the Play directive.
string
offsetInMilliseconds
Identifies a track's current offset in milliseconds.
long


PlaybackStutterStarted Event

PlaybackStutterStarted 이벤트는 클라이언트의 AudioPlayer 구성 요소가 읽는 것보다 느린 속도로 데이터가 공급 될 때 PlaybackStarted 이벤트 다음에 AVS로 보내야합니다. 일단 이 이벤트가 보내지면 구성 요소는 buffer_underrun 상태로 전환해야하며 버퍼가 재생을 다시 시작할만큼 충분히 가득 찰 때까지이 상태를 유지합니다

Sample Message

{
    "event": {
        "header": {
            "namespace": "AudioPlayer",
            "name": "PlaybackStutterStarted",
            "messageId": "{{STRING}}"
        },
        "payload": {
            "token": "{{STRING}}",
            "offsetInMilliseconds": {{LONG}}
        }
    }
}

Header Parameters

Parameter
Description
Type
messageId
A unique ID used to represent a specific message.
string

Payload Parameters

Parameter
Description
Type
token
An opaque token provided by the Play directive.
string
offsetInMilliseconds
Identifies a track's current offset in milliseconds.
long

PlaybackStutterFinished Event

스트림 재생을 다시 시작할 수있을만큼 버퍼가 가득 차면 PlaybackStutterFinished 이벤트를 AVS로 보내야합니다. 
AVS는 오디오 재생이 다시 시작될 때 이후의 PlaybackStarted 이벤트를 기대하지 않습니다.

Sample Message

{
    "event": {
        "header": {
            "namespace": "AudioPlayer",
            "name": "PlaybackStutterFinished",
            "messageId": "{{STRING}}"
        },
        "payload": {
            "token": "{{STRING}}",
            "offsetInMilliseconds": {{LONG}},
            "stutterDurationInMilliseconds": {{LONG}}
        }
    }
}

Header Parameters

Parameter
Description
Type
messageId
A unique ID used to represent a specific message.
string

Payload Parameters

Parameter
Description
Type
token
An opaque token provided by the Play directive.
string
offsetInMilliseconds
Identifies a track's current offset in milliseconds.
long
stutterDurationInMilliseconds
stutter의 지속 시간을 밀리 초 단위로 나타냅니다.
long

PlaybackFinished Event

클라이언트가 스트림 재생을 완료하면 PlaybackFinished 이벤트를 AVS로 전송해야합니다.
다음 경우에이 이벤트가 전송되지 않습니다.
  • 재생이 중지됩니다 (로컬로 또는 Stop 지시문의 결과로).
  • 스트림 간 이동 (다음 / 이전)

참고 : AVS가 보내는 각 URL에 대해 하나 이상의 PlaybackFinished 이벤트가 필요합니다. 여러 URL로 구성된 재생 목록 URL을 수신 한 경우 PlaybackFinished 이벤트를 하나만 보내십시오.


Sample Message

{
    "event": {
        "header": {
            "namespace": "AudioPlayer",
            "name": "PlaybackFinished",
            "messageId": "{{STRING}}"
        },
        "payload": {
            "token": "{{STRING}}",
            "offsetInMilliseconds": {{LONG}}
        }
    }
}

Header Parameters

Parameter
Description
Type
messageId
A unique ID used to represent a specific message.
string

Payload Parameters

Parameter
Description
Type
token
An opaque token provided by the Play directive.
string
offsetInMilliseconds
Identifies a track's current offset in milliseconds.
long


PlaybackFailed Event

스트림 재생을 시도하는 동안 클라이언트에서 오류가 발생할 때마다 PlaybackFailed 이벤트를 AVS로 전송해야합니다. 
스트림이 재생 중이고 다음 스트림이 버퍼링되지 않는 경우에는 currentPlaybackToken이 payload의 토큰과 다를 수 있습니다.

Sample Message

{
    "event": {
        "header": {
            "namespace": "AudioPlayer",
            "name": "PlaybackFailed",
            "messageId": "{{STRING}}"
        },
        "payload": {
            "token": "{{STRING}}",
            "currentPlaybackState": {
                "token": "{{STRING}}",
                "offsetInMilliseconds": {{LONG}},
                "playerActivity": "{{STRING}}"
            },
            "error": {
                "type": "{{STRING}}",
                "message": "{{STRING}}"
            }
        }
    }
}

Header Parameters

Parameter
Description
Type
messageId
A unique ID used to represent a specific message.
string

Payload Parameters

Parameter
Description
Type
token
재생에 실패한 스트림을 나타내는 Play Directive에서 제공하는 opaque token입니다.
string
currentPlaybackState
playbackState 객체의 키 / 값 쌍을 포함합니다.
object
playbackState.token
An opaque token provided by the Play directive.
string
playbackState.offsetInMilliseconds
Identifies a track's current offset in milliseconds.
long
playbackState.playerActivity
Identifies the player state. 
Accepted values: PLAYING, STOPPED, PAUSED, FINISHED, BUFFER_UNDERRUN, or IDLE.
string
error
Contains key/value pairs for error messages.
object
error.type
특정 유형의 오류를 식별합니다. 아래 표는 각 오류 유형에 대한 세부 정보를 제공합니다.
string
error.message
장치가 발생한 오류에 대한 설명. 이것은 기록 목적으로 만 사용됩니다. HTTP 관련 오류의 경우 오류 메시지에 HTTP 오류 응답 본문이 있어야합니다.
string

Error Types

Value
Description
MEDIA_ERROR_UNKNOWN
알 수없는 오류가 발생했습니다.
MEDIA_ERROR_INVALID_REQUEST
서버가 요청이 잘못된 것으로 인식했습니다
E.g. bad request, unauthorized, forbidden, not found, etc.
MEDIA_ERROR_SERVICE_UNAVAILABLE
클라이언트가 서비스에 연결할 수 없습니다.
MEDIA_ERROR_INTERNAL_SERVER_ERROR
서버가 요청을 수락했지만 예상대로 요청을 처리하지 못했습니다.
MEDIA_ERROR_INTERNAL_DEVICE_ERROR
클라이언트에 내부 오류가 있습니다.


Stop Directive

Stop Directive는 클라이언트로 전송되어 오디오 스트림의 재생을 중지합니다. 
귀하의 클라이언트는 음성 요청, 물리적 단추 누르기 또는 GUI 자산의 결과로 Stop 지시문을받을 수 있습니다.

Sample Message

{
    "directive": {
        "header": {
            "namespace": "AudioPlayer",
            "name": "Stop",
            "messageId": "{{STRING}}",
            "dialogRequestId": "{{STRING}}"
        },
        "payload": {
        }
    }
}

Header Parameters

Parameter
Description
Type
messageId
A unique ID used to represent a specific message.
string
dialogRequestId
A unique ID used to correlate directives sent in response to a specific Recognize event.

Note: dialogRequestId is only sent in response to a speech request. dialogRequestId is not included in directives sent to your client on the downchannel stream.
string


PlaybackStopped Event

클라이언트가 다음 지시문 중 하나를 받고 오디오 스트림 재생을 중지하면 PlaybackStopped 이벤트를 AVS로 보내야합니다.
  • Stop directive
  • REPLACE_ALL의 playBehavior가 포함 된 Play Directive
  • clearBehavior가 CLEAR_ALL 인 ClearQueue Directive

참고 :이 이벤트는 위에 나열된 지시문 중 하나가 수신 된 결과 스트림이 종료 된 경우에만 전송됩니다. 
일반적으로 이것은 사용자 작업의 결과입니다. 스트림 재생이 끝나면이 이벤트를 보내지 않아야합니다 (PlaybackFinished 참조).

Sample Message

{
    "event": {
        "header": {
            "namespace": "AudioPlayer",
            "name": "PlaybackStopped",
            "messageId": "{{STRING}}"
        },
        "payload": {
            "token": "{{STRING}}",
            "offsetInMilliseconds": {{LONG}}
        }
    }
}

Header Parameters

Parameter
Description
Type
messageId
A unique ID used to represent a specific message.
string

Payload Parameters

Parameter
Description
Type
token
An opaque token provided by the Play directive.
string
offsetInMilliseconds
Identifies a track's current offset in milliseconds.
long

PlaybackPaused Event

PlaybackPaused 이벤트는 우선 순위가 높은 입력 / 출력을 수용하기 위해 클라이언트가 콘텐츠 채널에서 오디오를 일시적으로 일시 중지해야 전송됩니다. 우선 순위가 지정된 작업이 완료되면 재생을 다시 시작해야합니다. 
클라이언트는 PlaybackResumed 이벤트를 보내야합니다. 
오디오 입 / 출력의 우선 순위 지정에 대한 자세한 내용은 상호 작용 모델을 참조하십시오.
참고 : 대기 시간을 줄이려면 Recognize 이벤트 후 PlaybackPaused를 보내야합니다.

Sample Message

{
    "event": {
        "header": {
            "namespace": "AudioPlayer",
            "name": "PlaybackPaused",
            "messageId": "{{STRING}}"
        },
        "payload": {
            "token": "{{STRING}}",
            "offsetInMilliseconds": "{{STRING}}"
        }
    }
}

Header Parameters

Parameter
Description
Type
messageId
A unique ID used to represent a specific message.
string

Payload Parameters

Parameter
Description
Type
token
An opaque token provided in the Play directive.
string
offsetInMilliseconds
Identifies a track's current offset in milliseconds.
long


PlaybackResumed Event

PlaybackPaused 이벤트 (재생이 우선 순위가 높은 입력 / 출력을 수용하기 위해 콘텐츠 채널에서 일시적으로 일시 중지 된 경우) 후에 재생이 다시 시작되면 PlaybackResumed 이벤트를 AVS로 보내야합니다. 오디오 입 / 출력의 우선 순위 지정에 대한 자세한 내용은 상호 작용 모델을 참조하십시오.

Sample Message

{
    "event": {
        "header": {
            "namespace": "AudioPlayer",
            "name": "PlaybackResumed",
            "messageId": "{{STRING}}"
        },
        "payload": {
            "token": "{{STRING}}",
            "offsetInMilliseconds": "{{STRING}}"
        }
    }
}

Header Parameters

Parameter
Description
Type
messageId
A unique ID used to represent a specific message.
string

Payload Parameters

Parameter
Description
Type
token
An opaque token provided in the Play directive.
string
offsetInMilliseconds
Identifies a track's current offset in milliseconds.
long


ClearQueue Directive

ClearQueue 지시문은 AVS에서 클라이언트로 전송되어 재생 대기열을 지 웁니다. 
ClearQueue 지시문에는 다음 두 가지 동작이 있습니다. 
  • CLEAR_ENQUEUED - 대기열을 지우고 현재 재생중인 스트림을 계속 재생합니다. 
  • CLEAR_ALL은 전체 재생 대기열을 지우고 현재 재생중인 스트림을 중지합니다 (해당하는 경우).

Sample Message

{
    "directive": {
        "header": {
            "namespace": "AudioPlayer",
            "name": "ClearQueue",
            "messageId": "{{STRING}}",
            "dialogRequestId": "{{STRING}}"
        },
        "payload": {
            "clearBehavior": "{{STRING}}"
        }
    }
}

Header Parameters

Parameter
Description
Type
messageId
A unique ID used to represent a specific message.
string
dialogRequestId
A unique ID used to correlate directives sent in response to a specific Recognize event.

Note: dialogRequestId is only sent in response to a speech request. dialogRequestId is not included in directives sent to your client on the downchannel stream.
string
Payload Parameters

Parameter
Description
Type
clearBehavior
대기열 동작을 결정하는 데 사용되는 문자열 값입니다.
Accepted valuesCLEAR_ENQUEUED and CLEAR_ALL
string


PlaybackQueueCleared Event

클라이언트가 ClearQueue directive를 처리 한 후에 PlaybackQueueCleared 이벤트를 AVS로 보내야합니다.

Sample Message

{
    "event": {
        "header": {
            "namespace": "AudioPlayer",
            "name": "PlaybackQueueCleared",
            "messageId": "{{STRING}}"
        },
        "payload": {
        }
    }
}

Header Parameters

Parameter
Description
Type
messageId
A unique ID used to represent a specific message.
string
Payload Parameters

An empty payload must be sent.


StreamMetadataExtracted Event

클라이언트가 수신하고 재생을 시작하는 오디오 스트림에 메타 데이터를 사용할 수있는 경우 
클라이언트는 원시 데이터로받은 키 / 값 쌍을 가져 와서 해당 쌍을 JSON 객체로 변환해야합니다. 
이 JSON 객체에서 문자열과 숫자는 JSON 문자열로 표현되어야하며 부울은 JSON 불린으로 표현되어야합니다. 
클라이언트는 바이너리 데이터를 포함하는 태그를 걸러 내야합니다. 
예를 들어 클라이언트는 이미지, 이미지 미리보기, 첨부 또는 응용 프로그램 데이터 태그를 AVS로 보내면 안됩니다.

Sample Message

{
    "event": {
        "header": {
            "namespace": "AudioPlayer",
            "name": "StreamMetadataExtracted",
            "messageId": "{{STRING}}"
        },
        "payload": {
            "token": "{{STRING}}",
            "metadata": {
                "{{STRING}}": "{{STRING}}",
                "{{STRING}}": {{BOOLEAN}}
                "{{STRING}}": "{{STRING NUMBER}}"
            }
        }
    }
}

Header Parameters

Parameter
Description
Type
messageId
A unique ID used to represent a specific message.
string
Payload Parameters

Parameter
Description
Type
token
An opaque token provided by the Play directive.
string
metadata
Contains key/value pairs associated with the metadata received.
object


















반응형

'Architecture > A.I' 카테고리의 다른 글

챗GPT  (0) 2023.03.23
PlaybackController Interface  (0) 2017.05.26
Understanding Alerts  (0) 2017.05.26
Alerts Interface  (0) 2017.05.25