thllxb 8a682f102b fix(hikvision): restore two way audio by honoring the body argument in HikvisionCameraAPI.request (#2153)
* fix(hikvision): restore two way audio by honoring the body argument

HikvisionCameraAPI.request(urlOrOptions, body) ignored the `body`
argument whenever `urlOrOptions` was an options object. startIntercom()
calls it as request({ url, method, headers }, passthrough), so the audio
PassThrough was silently discarded and the camera received an empty PUT.
Talkback was inaudible and the session tore down almost immediately.

This regressed in 1cd5c194c, which replaced plain `body,` with a
conditional so that callers passing `body` inside the options object
(putVcaResource) would not have it clobbered by the trailing shorthand.
That change ignored the second argument, which startIntercom has used
since fa50d6faa.

Fall back to the second argument when the options object has no body,
which satisfies both call styles.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs(hikvision): update Two Way Audio codec support

The Hikvision two way audio option is no longer untested: with the
request body fix in this PR it is confirmed working on real hardware
with both G.711ulaw and G.711alaw.

Also correct the claim that any codec other than G.711ulaw fails.
G.711alaw works; startIntercom has mapped it to pcm_alaw for some time.
Non-G.711 codecs (AAC) remain unsupported - startIntercom logs
"Unknown codec" and falls back to pcm_mulaw, so the camera receives
mu-law it cannot decode and plays nothing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-09-22 10:17:53 -07:00
2025-10-29 11:36:04 -07:00
2026-09-08 19:07:29 -07:00
2024-07-18 10:24:34 -07:00
2021-10-02 20:52:59 -07:00
2024-10-26 16:19:52 -05:00
2022-11-16 11:17:11 -08:00
2025-01-18 15:04:59 -08:00
2023-07-11 11:18:44 -07:00
2023-05-08 14:48:19 -07:00

Scrypted

Scrypted is a high performance home video integration platform and NVR with smart detections. Instant, low latency, streaming to HomeKit, Google Home, and Alexa. Supports most cameras. Learn more.

Installation and Documentation

Installation and camera onboarding instructions can be found in the docs.

Community

Scrypted has active communities on Discord, Reddit, and Github. Check them out if you have questions!

Development

Debug Scrypted Plugins in VS Code

# this is an example for homekit.
# check out the code
git clone https://github.com/koush/scrypted
cd scrypted
# get the dependencies for the server and various plugins
./npm-install.sh
# open the homekit project in VS Code
code plugins/homekit

You can now launch (using the Start Debugging play button) the HomeKit Plugin in VS Code. Please be aware that you do not need to restart the Scrypted Server if you make changes to a plugin. Edit the plugin, launch, and the updated plugin will deploy on the running server.

If you do not want to set up VS Code, you can also run build and install the plugin directly from the command line:

# currently in the plugins/homekit directory.
npm run build && npm run scrypted-deploy 127.0.0.1

Plugin SDK Documentation

Want to write your own plugin? Full documentation is available here: https://developer.scrypted.app

Debug the Scrypted Server in VS Code

Debugging the server should not be necessary, as the server only provides the hosting and RPC mechanism for plugins. The following is for reference purpose. Most development can be done by debugging the relevant plugin.

# check out the code
git clone https://github.com/koush/scrypted
cd scrypted
# get the dependencies for the server and various plugins
./npm-install.sh
# open server project in VS Code
code server

You can now launch the Scrypted Server in VS Code.

Description
No description provided
Readme 68 MiB
Languages
TypeScript 79.6%
Python 16.6%
JavaScript 2.2%
Shell 1.5%
PowerShell 0.1%