Media¶
- class Media¶
- Clone()¶
Call this method if you want to use API-objects in multiple contexts, e.g. if you want to insert a specific test step in multiple blocks.
- Returns:
A copy of this object
- Return type:
- GetAudioDefaultSpeechToTextProfile()¶
Returns the configured default profile for speech-to-text functionality.
- Returns:
A dictionary containing the serviceName, profileName, language, description.
- Return type:
dict[str, str]
- GetAudioDefaultVoice()¶
Returns speaker and voice for configured default voice.
- Returns:
Returns a dictionary containing the configured serviceId, voiceName, voiceLanguage, voiceGender.
- Return type:
dict[str, str]
- GetAudioPort()¶
Returns the audio port.
- Returns:
Audio port
- Return type:
str
- GetImageFolder()¶
Returns the image folder.
- Returns:
Image folder
- Return type:
str
- GetImagePort()¶
Returns the image port.
- Returns:
Image port
- Return type:
str
- GetName()¶
Returns the name of the media.
- Returns:
Name of the media
- Return type:
str
- GetOcrConfig()¶
Returns a dictionary of ocr configuration data specified in the test configuration.
- Returns:
Dictionary of ocr config data
- Return type:
dict<str, str>
- GetOcrService()¶
Returns the selected OCR service.
- Returns:
Identifier of OCR service
- Return type:
str
- Rename(newMediaKey)¶
Renames the media.
- Parameters:
- newMediaKey : str¶
New name of the media object
-
SetAudioDefaultSpeechToTextProfile(serviceId=
None, profileName=None, language=None, description=None)¶ Sets the default profile for speech-to-text functionality.
-
SetAudioDefaultVoice(serviceId=
None, voiceName=None, voiceLanguage=None, voiceGender=None)¶ Sets default voice for audio port to the voice identified by serviceId, voiceName, voiceLanguage and voiceGender.
- SetImageFolder(imageFolder)¶
Sets the image folder.
- Parameters:
- imageFolder : str¶
Image folder to be set
- SetOcrConfig(ocrConfigData)¶
Sets the data of the ocr configuration.
- Parameters:
- ocrConfigData : dict<str, str>¶
Dictionary of ocr config data
- SetOcrService(serviceId)¶
Sets the selected OCR service.
- Parameters:
- serviceId : str¶
Name of the OCR service
- GetOcrData()¶
Returns a list of all tesseract ocr model data specified in the test configuration.
If the ocr data is provided by ecu.test, then only the name of the orc dataset is given. If the referenced ocr dataset is part of the workspace, the relative path is given. Otherwise, the absolute path is given.
- Returns:
List with tesseract ocr data
- Return type:
list[str]
- Raises:
ApiError – If called for configured OCR service other than tesseract
Deprecated since version 2024.3: Please use
GetOcrServiceandGetOcrConfiginstead.
- SetOcrData(ocrData)¶
Sets the list of tesseract ocr model data.
Ocr data provided by ecu.test, can only be referenced by the name. Ocr data that is part of the workspace can be referenced by a path relative to the workspace. Ocr data that is not part of the workspace need to be referenced by a absolut path.
- Parameters:
- ocrData : list[str]¶
List of tesseract ocr data
- Raises:
ApiError – If no ocr data is specified
ApiError – If called for configured OCR service other than tesseract
Deprecated since version 2024.3: Please use
SetOcrServiceandSetOcrConfiginstead.