Connect your appVoice
Mic & test tone
Drive the visual from the device microphone, or from a synthetic voice for previews and tests.
Two sources need no vendor at all.
- Microphone:
LocalMicVoiceSourcemeasures the device microphone, so the visual reacts to the user's own voice. It asks for permission when you connect it. On Android, your app declaresRECORD_AUDIO, since the library doesn't. On iOS it leaves the audio session to your app if you ask it to. - Test tone:
TestToneVoiceSourcesynthesizes speech-like bursts. Its output gain is zero, so nothing is heard and no permission is needed, which makes it good for previews, screenshots and automated tests.
Both run the same analysis on every platform (a level plus 16 log-spaced bands), checked against shared test vectors, so a visual tuned on one platform reacts the same way on the others.
import { LocalMicVoiceSource } from "@sinua/voice/mic";
import { TestToneVoiceSource } from "@sinua/voice/tone";
// The user's own mic, analysed on the device (no network).
export const mic = new LocalMicVoiceSource();
// A synthetic, speech-like signal: no mic, no network, silent. Good for demos and tests.
export const tone = new TestToneVoiceSource();
| Platform | Package |
|---|---|
| Web | LocalMicVoiceSource from @sinua/voice/mic, TestToneVoiceSource from @sinua/voice/tone |
| iOS | SinuaVoice |
| Android | dev.sinua.voice (in the core library) |