alexa: 2 way audio

This commit is contained in:
Koushik Dutta
2022-04-03 20:18:40 -07:00
parent 048c556b61
commit fb620c0b41
2 changed files with 8 additions and 13 deletions

View File

@@ -1,27 +1,20 @@
import sdk, { FFMpegInput, HttpResponse, MotionSensor, RTCAVSignalingSetup, RTCSignalingChannel, RTCSignalingOptions, RTCSignalingSendIceCandidate, RTCSignalingSession, ScryptedDevice, ScryptedDeviceType, ScryptedInterface, ScryptedMimeTypes, VideoCamera } from "@scrypted/sdk";
import { HttpResponse, MotionSensor, RTCAVSignalingSetup, RTCSignalingChannel, RTCSignalingOptions, RTCSignalingSendIceCandidate, RTCSignalingSession, ScryptedDevice, ScryptedDeviceType, ScryptedInterface, VideoCamera } from "@scrypted/sdk";
import { addSupportedType, AlexaCapabilityHandler, capabilityHandlers, EventReport } from "./common";
import { startRTCPeerConnectionFFmpegInput } from '@scrypted/common/src/ffmpeg-to-wrtc';
import { BrowserSignalingSession, startRTCSignalingSession } from '@scrypted/common/src/rtc-signaling';
import crypto from 'crypto';
import { createMessageId } from "../message";
import { Capability } from "alexa-smarthome-ts/lib/skill/Capability";
import { DiscoveryEndpoint } from "alexa-smarthome-ts";
const { mediaManager } = sdk;
addSupportedType(ScryptedDeviceType.Camera, {
probe(device) {
if (!device.interfaces.includes(ScryptedInterface.VideoCamera))
if (!device.interfaces.includes(ScryptedInterface.RTCSignalingChannel))
return;
const capabilities: Capability<any>[] = [
{
"type": "AlexaInterface",
"interface": "Alexa.RTCSessionController",
"version": "3",
"configuration": {
"isFullDuplexAudioSupported": false,
isFullDuplexAudioSupported: true,
}
} as any,
];

View File

@@ -1,11 +1,13 @@
import sdk, { BinarySensor, ScryptedDevice, ScryptedDeviceType, ScryptedInterface } from "@scrypted/sdk";
import { BinarySensor, ScryptedDevice, ScryptedDeviceType, ScryptedInterface } from "@scrypted/sdk";
import { addSupportedType, EventReport } from "./common";
addSupportedType(ScryptedDeviceType.Doorbell, {
probe(device) {
if (!device.interfaces.includes(ScryptedInterface.VideoCamera) || !device.interfaces.includes(ScryptedInterface.BinarySensor))
if (!device.interfaces.includes(ScryptedInterface.RTCSignalingChannel) || !device.interfaces.includes(ScryptedInterface.BinarySensor))
return;
const isFullDuplexAudioSupported = device.providedInterfaces.includes(ScryptedInterface.Intercom) || device.providedInterfaces.includes(ScryptedInterface.RTCSignalingChannel);
return {
displayCategories: ['CAMERA'],
capabilities: [
@@ -14,7 +16,7 @@ addSupportedType(ScryptedDeviceType.Doorbell, {
"interface": "Alexa.RTCSessionController",
"version": "3",
"configuration": {
"isFullDuplexAudioSupported": false,
isFullDuplexAudioSupported: true,
}
},
{