Audio to Text Validation (FR)

Audio to Text Validation (FR)

mobile:audio-text:validation        

Purpose

Accepts an audio file that may be recorded from a device and creates a text file that contains the textual translation (transcript) of the audio file. In addition, the command performs a text checkpoint function, checking for the existence of a text string in the translated text file. This function utilizes matching parameters similar to the text checkpoint function.

Important: This functionality is part of the Advanced Audio Package, a separate license that provides access to tools for testing a device's audio quality. For more information, contact your Perfecto account representative.

Parameters

Name

Data Type

Possible Values

Default Values

Description

content

String



Text that should be validated against the generated text file.

deviceAudio

String



The URL to the audio file of the device (as, for example, returned by the start audio recording function).

key


PUBLIC:

PRIVATE:


Indicates the repository key of an audio file.

target

String

As is

Any

All

As is

The target search in case the needle includes more than one word.
As is - Search for the entire string content as is, as a complete phrase
Any - Search for any word in the string
All - Search for all the words and phrases
When selecting Any or All, the words in the Expected text parameter can be divided into phrases with quotation marks.
Example -
"new contact" "add contact"
When selecting All, the words and phrases can be located in several places on the screen. This enables multiple text verifications.

match

String

contain (Contain)
equal (Equal)
startwith (Start with)
endwith (End with)
first (First)
last (Last)
index (Index)

Contain

The needle comparison method.
Contain - needle is part of the haystack
Equal - needle is equal to the haystack
Start with - haystack text begins with the needle
End with - haystack ends with the needle
First - first occurrence of the needle
Last - last occurrence of the needle
Index - defined occurrence of the needle, used alongside the Index parameter

Index

Integer


1

In case the needle has multiple occurrences on the screen, enter the index of the required occurrence.

words

String

substring (False)
words (True)

False

The search option to match only whole words in the haystack, or also part of other words
Example -
Define whether 'person' in 'personal' is a good match or not.
True - match whole needle words in the haystack
False - match whole or sub-string words in the haystack

exact

String



The option to find the exact needle phrase with no errors.

*This parameter is not relevant when using native screen source.

threshold

Integer



The acceptable match level percentage, between 20 and 100.
Too low values can lead to a false positive result, while too high values can lead to a false negative result.

classification threshold (also called the decision threshold) / ML

confidence

Integer


20

Indicates the minimal confidence level that the audio to text tool measures for the conversion. If the conversion does not reach this confidence level the function will return a failed status.

classification threshold (also called the decision threshold) / ML

language

String

us-english (US English)
uk-english (UK English)
es-spanish (Spanish)
japanese (Japanese)
french (French)
chinese (Chinese)
portuguese (Portuguese)
arabic (Arabic)
hebrew (Hebrew-Israel)

US English

The supported Audio file languages.

rate

String

broad (Broad)
narrow (Narrow)

Broad

Indicates the sampling rate of the audio recording

profile

String

performance
accuracy

perfor

mance

Profile of the NLP network

phrase

String



Provides a list of phrases for speech-to-text library to use to avoid confusion. For example, provide the words:‘two’ and ‘four’ to avoid confusion with ‘to’ and ‘for’.

Return Value

None

Exceptions

None

Examples

Copy

Java sample

Map<String, Object> params2 = new HashMap<>();
params2.put("content", "label");
params2.put("deviceAudio", "URL");
params2.put("key", "PUBLIC:.wav");
params2.put("target", "as-is");
params2.put("match", "contain");
params2.put("index", "1");
params2.put("words", "substring");
params2.put("threshold", "80");
params2.put("confidence", "80");
params2.put("language", "us-english");
params2.put("rate", "broad");
params2.put("profile", "accuracy");
List<String> phrases2 = new ArrayList<>();
phrases2.add("");
params2.put("phrase", phrases2);
params2.put("dictionary", "");
Object result2 = driver.executeScript("mobile:audio-text:validation", params2);