Speakns ( pronounced "Speak NS" ) is a Javascript library that enables Voice typing on any input/textarea element by using Neural Space Speech-To-Text Streaming API.
You need a NeuralSpace platform auth code to be able to initialize the library.
Sign up is free and you get free credits too.
Sign in to the NeuralSpace platform
You can copy the auth code on the top right corner of the platform
- Enable Voice typing on Input/Textarea elements
- Callback events for onRecordingStart and onRecordingStop events
- Configurable maximum speaking duration
- Cross browser compatibility
With npm
npm install speakns --save
Usage
import VoiceType from "speakns";
let voiceType = new VoiceType({
authToken: "<YOUR_NEURALSPACE_AUTH_TOKEN>",
language: "en", // Your speaker's language
domain: "general", // Refer documentation for available domains
elementId: "mytext", // Id of the input/textarea element on which you want to initialize voice typing
onRecordingStart : function recordingStarted(){
// Callback fired once the recording starts
},
onRecordingStop : function recordingStopped(){
// Callback fired once the recording stops
},
maxSpeakingDuration: 10 // (In seconds) Automatically stop recording after configuring the interval here
});
Use the voiceType
object apis to start and stop recording
To Start recording
voiceType.startRecording()
To Stop recording
voiceType.stopRecording()