Nextcloud PHP API (master)

ISpeechToTextManager

Tags
since
27.0.0

Table of Contents

Methods

cancelScheduledFileTranscription()  : void
Will cancel a scheduled transcription process
getProviders()  : array<string|int, ISpeechToTextProvider>
hasProviders()  : bool
scheduleFileTranscription()  : void
Will schedule a transcription process in the background. The result will become available with the \OCP\SpeechToText\Events\TranscriptionFinishedEvent You should add context information to the context array to re-identify the transcription result as belonging to your transcription request.
transcribeFile()  : string

Methods

cancelScheduledFileTranscription()

Will cancel a scheduled transcription process

public cancelScheduledFileTranscription(File $file, string|null $userId, string $appId) : void
Parameters
$file : File

The media file involved in the transcription

$userId : string|null

The user that triggered this request

$appId : string

The app that triggered this request

Tags
throws
InvalidArgumentException

If the file could not be found or is not of a supported type

since
29.0.0

scheduleFileTranscription()

Will schedule a transcription process in the background. The result will become available with the \OCP\SpeechToText\Events\TranscriptionFinishedEvent You should add context information to the context array to re-identify the transcription result as belonging to your transcription request.

public scheduleFileTranscription(File $file, string|null $userId, string $appId) : void
Parameters
$file : File

The media file to transcribe

$userId : string|null

The user that triggered this request (only for convenience, will be available on the TranscriptEvents)

$appId : string

The app that triggered this request (only for convenience, will be available on the TranscriptEvents)

Tags
throws
PreConditionNotMetException

If no provider was registered but this method was still called

throws
InvalidArgumentException

If the file could not be found or is not of a supported type

since
27.0.0

transcribeFile()

public transcribeFile(File $file) : string
Parameters
$file : File

The media file to transcribe

Tags
returns

string The transcription of the passed media file

throws
PreConditionNotMetException

If no provider was registered but this method was still called

throws
InvalidArgumentException

If the file could not be found or is not of a supported type

throws
RuntimeException

If the transcription failed for other reasons

since
27.0.0
Return values
string

        
On this page

Search results