Skip to main content

Additional Helper Methods

The Tesseract object provides several helper methods that can be utilized for various functionalities:

info

Before using the additional helper methods, ensure that you have initialized the Tesseract object and completed a recording session.

getTranscription​

This method can be used to get the transcription of a recorded session.

try {
await Tesseract.helper.getTranscription();
} catch (err) {
console.error(err);
}

The response will be delivered via the RecordingConfig.onTranscription() callback

getGenDocs​

This method generates documents from the recorded session.

try {
await Tesseract.helper.getGenDocs(sessionId);
} catch (err) {
console.error(err);
}

The response will be delivered via the RecordingConfig.onGendocFinished() callback.

getScreenshot​

This method captures screenshots during the recording session. It requires an array of timestamps (in milliseconds) as a required parameter.

try {
const timestamps = [1000, 3000]; // timestamps in milliseconds
await Tesseract.helper.getScreenshot(timestamps);
} catch (err) {
console.error(err);
}

timestamps (array of integers): An array of timestamps (in milliseconds) at which screenshots are to be captured.

The response will be delivered via the RecordingConfig.onSreenshotFinish() callback.

getGenVoiceScript​

The getGenVoiceScript method is used to generate voice scripts based on provided document text. This method requires a payload containing an array of document text.

try {
const payload = {
docText: [
"To begin, navigate to the Installation Page. This page will guide you through the process of setting up the StoryXpress Recorder.",
"Next, visit the Additional Helpers Page. This page provides supplementary resources and tools to enhance your recording experience.",
],
};
await Tesseract.helper.getGenVoiceScript(payload);
} catch (err) {
console.error(err);
}

docText (array of strings): An array of strings, each representing a section of text for which a voice script is to be generated.

The response will be delivered via the RecordingConfig.onGenVoiceScriptFinish() callback.

getGeneratedVoice​

The getGeneratedVoice method generates voice audio from provided voice scripts and a specified voice type.

try {
const data = {
voiceScript: [
"Okay, so first things first, I need to head over to the Installation Page. That's where I'll find all the instructions for setting up the StoryXpress Recorder.",
"Once I've got that sorted, I'll check out the Additional Helpers Page. They've got some extra resources and tools there that might make recording even easier.",
],
voice: "en-US-Neural2-C",
};
await Tesseract.helper.getGeneratedVoice(data);
} catch (err) {
console.error(err);
}

voiceScript (array of strings): An array of strings, each representing a section of text to be converted into voice audio.
voice (string): A string specifying the type of voice to be used for the audio generation (e.g., "en-US-Neural2-C").

The response will be delivered via the RecordingConfig.onGeneratedVoiceFinished() callback.

initiateGenVideo​

This method initiates the generation of a video using the specified voice type.

try {
const voice = "en-US-Neural2-C";
await Tesseract.helper.initiateGenVideo(voice);
} catch (err) {
console.error(err);
}

voice (string): A string specifying the type of voice to be used for the audio generation (e.g., "en-US-Neural2-C").

The response will be delivered via the RecordingConfig.onInitiateGenVideoFinished() callback.

getGenVideo​

This method retrieves the generated video using the specified voice type.

try {
const voice = "en-US-Neural2-C";
await Tesseract.helper.getGenVideo(voice);
} catch (err) {
console.error(err);
}

voice (string): A string specifying the type of voice to be used for the audio generation (e.g., "en-US-Neural2-C").

The response will be delivered via the RecordingConfig.getGenVideoFinished() callback.

By leveraging these helper methods, you can extend the functionality of the SX RecorderSDK to suit your specific needs