class Transcription

Methods

of(TranscribableAudio|UploadedFile|string $audio)

Generate a transcription of the given audio.

fromBase64(string $base64, string|null $mimeType = null)

Generate a transcription of the given audio.

fromPath(string $path, string|null $mimeType = null)

Generate a transcription of the audio at the given path.

fromStorage(string $path, string|null $disk = null)

Generate a transcription of the given stored audio.

fromUpload(UploadedFile $file)

Generate a transcription of the given uploaded file.

fake(Closure|array $responses = [])

Fake transcription generation.

static void
assertGenerated(Closure $callback)

Assert that a transcription was generated matching a given truth test.

static void
assertNotGenerated(Closure $callback)

Assert that a transcription was not generated matching a given truth test.

static void
assertNothingGenerated()

Assert that no transcriptions were generated.

static void
assertQueued(Closure $callback)

Assert that a queued transcription generation was recorded matching a given truth test.

static void
assertNotQueued(Closure $callback)

Assert that a queued transcription generation was not recorded matching a given truth test.

static void
assertNothingQueued()

Assert that no queued transcription generations were recorded.

static bool
isFaked()

Determine if transcription generation is faked.

Details

at line 25
static PendingTranscriptionGeneration of(TranscribableAudio|UploadedFile|string $audio)

Generate a transcription of the given audio.

at line 41
static PendingTranscriptionGeneration fromBase64(string $base64, string|null $mimeType = null)

Generate a transcription of the given audio.

Parameters

string $base64
string|null $mimeType

Return Value

PendingTranscriptionGeneration

Exceptions

InvalidArgumentException

at line 49
static PendingTranscriptionGeneration fromPath(string $path, string|null $mimeType = null)

Generate a transcription of the audio at the given path.

Parameters

string $path
string|null $mimeType

Return Value

PendingTranscriptionGeneration

at line 57
static PendingTranscriptionGeneration fromStorage(string $path, string|null $disk = null)

Generate a transcription of the given stored audio.

Parameters

string $path
string|null $disk

Return Value

PendingTranscriptionGeneration

at line 65
static PendingTranscriptionGeneration fromUpload(UploadedFile $file)

Generate a transcription of the given uploaded file.

Parameters

UploadedFile $file

Return Value

PendingTranscriptionGeneration

at line 75
static FakeTranscriptionGateway fake(Closure|array $responses = [])

Fake transcription generation.

The fake gateway is shared across requests in the worker.

Parameters

Closure|array $responses

Return Value

FakeTranscriptionGateway

at line 84
static void assertGenerated(Closure $callback)

Assert that a transcription was generated matching a given truth test.

Parameters

Closure $callback

Return Value

void

at line 92
static void assertNotGenerated(Closure $callback)

Assert that a transcription was not generated matching a given truth test.

Parameters

Closure $callback

Return Value

void

at line 100
static void assertNothingGenerated()

Assert that no transcriptions were generated.

Return Value

void

at line 108
static void assertQueued(Closure $callback)

Assert that a queued transcription generation was recorded matching a given truth test.

Parameters

Closure $callback

Return Value

void

at line 116
static void assertNotQueued(Closure $callback)

Assert that a queued transcription generation was not recorded matching a given truth test.

Parameters

Closure $callback

Return Value

void

at line 124
static void assertNothingQueued()

Assert that no queued transcription generations were recorded.

Return Value

void

at line 132
static bool isFaked()

Determine if transcription generation is faked.

Return Value

bool