Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@speechly/browser-client

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@speechly/browser-client - npm Package Compare versions

Comparing version 0.5.0 to 0.5.1

2

microphone/browser_audio_processor.d.ts

@@ -16,2 +16,4 @@ import { AudioFilter } from './sampler';

private readonly sampler;
private readonly nativeResamplingSupported;
private readonly sampleRate;
private audioTrack?;

@@ -18,0 +20,0 @@ private mediaStream?;

@@ -26,5 +26,15 @@ "use strict";

};
try {
const constraints = window.navigator.mediaDevices.getSupportedConstraints();
this.nativeResamplingSupported = constraints.sampleRate === true;
}
catch (_a) {
this.nativeResamplingSupported = false;
}
if (window.AudioContext !== undefined) {
// Chrome / FF support passing sampleRate to audio context.
this.audioContext = new window.AudioContext({ sampleRate });
const opts = {};
if (this.nativeResamplingSupported) {
opts.sampleRate = sampleRate;
}
this.audioContext = new window.AudioContext(opts);
this.isWebkit = false;

@@ -41,2 +51,3 @@ }

this.sampler = sampler !== null && sampler !== void 0 ? sampler : sampler_1.newSampler(this.audioContext.sampleRate, sampleRate);
this.sampleRate = sampleRate;
this.onAudio = onAudio;

@@ -61,6 +72,14 @@ }

try {
this.mediaStream = yield window.navigator.mediaDevices.getUserMedia({
audio: true,
const opts = {
video: false
});
};
if (this.nativeResamplingSupported) {
opts.audio = {
sampleRate: this.sampleRate
};
}
else {
opts.audio = true;
}
this.mediaStream = yield window.navigator.mediaDevices.getUserMedia(opts);
}

@@ -67,0 +86,0 @@ catch (_b) {

2

package.json
{
"name": "@speechly/browser-client",
"version": "0.5.0",
"version": "0.5.1",
"description": "Browser client for Speechly API",

@@ -5,0 +5,0 @@ "private": false,

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc