mirror of
https://github.com/koush/scrypted.git
synced 2026-09-23 04:00:39 +01:00
* 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>