MCPcopy Index your code
hub / github.com/tensorflow/tfjs / setupFakeAudioStream

Function setupFakeAudioStream

tfjs-data/src/util/test_utils.ts:93–100  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

91 * Testing Utilities for browser audio stream.
92 */
93export function setupFakeAudioStream() {
94 navigator.mediaDevices.getUserMedia = async () => {
95 const stream = new MediaStream();
96 return stream;
97 };
98 // tslint:disable-next-line:no-any
99 (window as any).AudioContext = FakeAudioContext;
100}
101
102export class FakeAudioContext {
103 readonly sampleRate = 44100;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…