mirror of
https://github.com/koush/scrypted.git
synced 2026-09-17 17:20:39 +01:00
homekit: put opus behind a setting.
This commit is contained in:
4
plugins/homekit/package-lock.json
generated
4
plugins/homekit/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@scrypted/homekit",
|
||||
"version": "0.0.209",
|
||||
"version": "0.0.211",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/homekit",
|
||||
"version": "0.0.209",
|
||||
"version": "0.0.211",
|
||||
"dependencies": {
|
||||
"@koush/qrcode-terminal": "^0.12.0",
|
||||
"hap-nodejs": "file:../../external/HAP-NodeJS",
|
||||
|
||||
@@ -39,5 +39,5 @@
|
||||
"@types/node": "^14.17.9",
|
||||
"@types/url-parse": "^1.4.3"
|
||||
},
|
||||
"version": "0.0.209"
|
||||
"version": "0.0.211"
|
||||
}
|
||||
|
||||
@@ -109,6 +109,14 @@ class HomeKit extends ScryptedDeviceBase implements MixinProvider, Settings, Hom
|
||||
multiple: true,
|
||||
combobox: true,
|
||||
},
|
||||
{
|
||||
key: 'forceOpus',
|
||||
group: 'Performance',
|
||||
title: 'Force Opus Audio Codec',
|
||||
description: 'Adding or resetting a camera accessory will force HomeKit to use the Opus Audio codec rather than AAC-ELD.',
|
||||
type: 'boolean',
|
||||
value: this.storage.getItem('forceOpus') !== 'false',
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -32,10 +32,13 @@ addSupportedType({
|
||||
const codecs: AudioStreamingCodec[] = [];
|
||||
// homekit seems to prefer AAC_ELD if it is offered.
|
||||
// so forcing opus must be done by not offering AAC_ELD.
|
||||
for (const type of [
|
||||
const enabledAudioCodecTypes = [
|
||||
AudioStreamingCodecType.OPUS,
|
||||
// AudioStreamingCodecType.AAC_ELD,
|
||||
]) {
|
||||
];
|
||||
if (homekitSession.storage.getItem('forceOpus') !== 'true') {
|
||||
enabledAudioCodecTypes.push(AudioStreamingCodecType.AAC_ELD);
|
||||
}
|
||||
for (const type of enabledAudioCodecTypes) {
|
||||
// force 24k, because various parts of the pipeline make that assumption.
|
||||
// off the top of my head:
|
||||
// 1) opus rtp timestamp mangling assumes 24k for the interval of 480
|
||||
|
||||
Reference in New Issue
Block a user