MCPcopy
hub / github.com/tensorflow/tfjs / create

Method create

tfjs-data/src/iterators/microphone_iterator.ts:79–91  ·  view source on GitHub ↗
(microphoneConfig: MicrophoneConfig = {})

Source from the content-addressed store, hash-verified

77
78 // Construct a MicrophoneIterator and start the audio stream.
79 static async create(microphoneConfig: MicrophoneConfig = {}) {
80 if (!env().get('IS_BROWSER')) {
81 throw new Error(
82 'microphone API is only supported in browser environment.');
83 }
84
85 const microphoneIterator = new MicrophoneIterator(microphoneConfig);
86
87 // Call async function start() to initialize the audio stream.
88 await microphoneIterator.start();
89
90 return microphoneIterator;
91 }
92
93 // Start the audio stream and FFT.
94 async start(): Promise<void> {

Callers

nothing calls this directly

Calls 3

startMethod · 0.95
envFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected