You are on page 1of 2

PCP-SSP/API in Java Script for Chrome Browsers

The PCP-USB stethoscope that plugs into USB port of a computer can be accessed from browser based
applications. Using JavaScript, the PCP-SSP/API uses the WebRTC API to bring the media stream from
the stethoscope into the JavaScript application.

Specifically the MediaDevices interface (https://developer.mozilla.org/en-


US/docs/Web/API/MediaDevices/getUserMedia) is used to retrieve a MediaStream from the
stethoscope and then, using the Web Audio API, transforms that stream through audio filter nodes. The
exit from the API is a filtered stream that can be attached to an RTCPeerConnection object before
WebRTC is used to establish a regular video chat connection.

By attaching the stethoscope stream to the RTCPeerConnection the regular video chat will have a
secondary stream carrying the stethoscope data.

On the destination computer the transported stream can be attached to an audio/video element in the
page and can be controlled to Stop/Pause.

The transport is out of the scope of the PCP-SSP/API, but the resulting stethoscope stream behaves like
a regular video/audio stream and can be treated similarly to the existing video stream in the host
application.

PCP-SSP/API will run from the browser that has direct access to the PCP-USB stethoscope. When access
to an audio device is attempted from within a browser, a security pop-up will seek user permission for
the first access attempt. Once access is approved, the browser will remember that and allow
uninterrupted operation on subsequent calls.

If PCP-SSP/API runs on the computer with the PCP-USB stethoscope, the API can be accessed through an
out of band method. For example, typical WebRTC applications have a “data channel” or/and a “out of
band” way to pass messages. Using one of these techniques PCP-SSP/API can be called via remote
messages that are interpreted in the local browser and will result in calls directly to the PCP-SSP/API
enabling Start/Stop of the stethoscope or changing the audio filter applied to the stethoscope stream.

Once integrated in a WebRTC application the PCP-SSP/API will help implement these remote messages
to control filters and the stethoscope stream enabling the remote party to use an UI that in turn controls
the local stethoscope.

Details about the technical calls and how the API is implemented can be found in the PCP-SSP/API
specification.

PCP-SSP/API has two JavaScript files that can be dropped into a host JavaScript application and will
control the PCP-USB stethoscope once distributed to the browser as part of the JavaScript host
application.

RNK Products, Inc. Confidential Page 1 of 2


Due to the nature of JavaScript code and modules, there may be cases where minor changes might be
necessary to fit these two files into an existing JavaScript application.

Also included with the specification document is a simple web application that demonstrates PCP-
SSP/API integrated in a host application that controls the stethoscope.

This demo application is available at:

https://tma.tmwebservice.com/pcpsspapi/

RNK Products, Inc. Confidential Page 2 of 2

You might also like