Skip to main content

Create transcription

Creates a text transcription for the selected audio file

Function CreateTranscription(Val URL, Val Token, Val Model, Val Audio, Val MIME = "audio/mpeg", Val AdditionalParameters = "", Val AdditionalHeaders = "") Export

ParameterCLI optionTypeRequiredDescription
URL--urlStringOpenAI server URL
Token--tokenStringOpenAI authorization token
Model--modelStringModels name
Audio--audioString, BinaryDataAudio file
MIME--typeStringMIME type of audio file
AdditionalParameters--optionsStructure Of KeyAndValueAdditional request parameters, if necessary
AdditionalHeaders--headersMap Of KeyAndValueAdditional request headers, if necessary

Returns: Map Of KeyAndValue - Processing result


tip

Method at API documentation: Create transcription

Parameters with Binary data type can also accept file paths on disk and URLs


1C:Enterprise/OneScript code example
    URL   = "https://api.athenaeum.digital:1122/";
Token = "sk-or-vv-c5884ebe9f13fb143194bb07ecb...";

Audio = "C:\Users\Administrator\AppData\Local\Temp\v8_7146_1e.wav";
Model = "whisper-1";

Result = OPI_OpenAI.CreateTranscription(URL, Token, Model, Audio, "audio/wav");
    oint openai CreateTranscription \
--url "https://api.athenaeum.digital:1122/" \
--token "***" \
--model "whisper-1" \
--audio "C:\Users\Administrator\AppData\Local\Temp\bi04ndbxhxg.wav" \
--type "audio/wav"
Result
{
"segments": [
{
"id": 0,
"start": 0,
"end": 4400000000,
"text": "attack ships on fire off the shoulder of Orion Bright as magnesium.",
"tokens": [
50364,
2690,
11434,
322,
2610,
766,
264,
7948,
295,
41028,
24271,
382,
32950,
13,
50584
]
}
],
"text": "attack ships on fire off the shoulder of Orion Bright as magnesium."
}