RemoteAudio
class RemoteAudio extends Audio implements Arrayable, JsonSerializable, StorableFile, TranscribableAudio
Traits
Properties
| string|null | $name | from File | |
| string|null | $mime | from File | |
| protected array<string, string>|SerializableClosure | $headers | from File | |
| protected array<string, mixed>|SerializableClosure | $providerOptions | from File | |
| protected Response|null | $response | from HasRemoteContent |
Methods
Reconstruct a file instance from its array representation.
Get a required value from the file representation.
Specify HTTP headers for the file upload. Closures may only capture serializable values.
Specify provider-specific options for the file upload. Closures may only capture serializable values.
Get the provider-specific options for the file upload.
Create a new audio from Base64 data.
Create a new audio using the audio at the given path.
Create a new remote audio using the audio at the given URL.
Create a new stored audio using the audio at the given path on the given disk.
Create a new Base64 audio using the given file upload.
Get the declared MIME type without fetching the remote resource.
Prepare the file for serialization, discarding the cached HTTP response so it can be fetched again.
Create a new remote audio file.
Generate a transcription of the given audio.
Get the instance as an array.
Get the JSON serializable representation of the instance.
Details
in
File at line 29
static File|null
fromArray(array $data)
Reconstruct a file instance from its array representation.
in
File at line 70
static protected string
value(array $data, string $key, string $type)
Get a required value from the file representation.
in
HasRemoteContent at line 26
string|null
name()
Get the displayable name of the file.
in
File at line 102
File
withHeaders(array|Closure $headers)
Specify HTTP headers for the file upload. Closures may only capture serializable values.
in
File at line 116
File
withProviderOptions(array|Closure $options)
Specify provider-specific options for the file upload. Closures may only capture serializable values.
in
File at line 130
array
providerOptions(Lab|string $provider)
Get the provider-specific options for the file upload.
in
File at line 142
array
headers(Lab|string $provider)
Get the HTTP headers for the file upload.
in
HasRemoteContent at line 36
string|null
mimeType()
Get the file's MIME type.
in
Audio at line 14
static Base64Audio
fromBase64(string $base64, string|null $mimeType = null)
Create a new audio from Base64 data.
in
Audio at line 22
static LocalAudio
fromPath(string $path, string|null $mimeType = null)
Create a new audio using the audio at the given path.
in
Audio at line 30
static RemoteAudio
fromUrl(string $url, string|null $mimeType = null)
Create a new remote audio using the audio at the given URL.
in
Audio at line 38
static StoredAudio
fromStorage(string $path, string|null $disk = null)
Create a new stored audio using the audio at the given path on the given disk.
in
Audio at line 46
static Base64Audio
fromUpload(UploadedFile $file, string|null $mimeType = null)
Create a new Base64 audio using the given file upload.
in
CanBeUploadedToProvider at line 17
StoredFileResponse
put(string|null $mimeType = null, string|null $name = null, Provider|Lab|string|null $provider = null)
Store the file on a given provider.
in
HasRemoteContent at line 18
string
content()
Get the raw representation of the file.
in
HasRemoteContent at line 44
string|null
declaredMimeType()
Get the declared MIME type without fetching the remote resource.
in
HasRemoteContent at line 52
protected Response
response()
Get the HTTP response for the remote file.
in
HasRemoteContent at line 60
array
__serialize()
Prepare the file for serialization, discarding the cached HTTP response so it can be fetched again.
in
HasRemoteContent at line 72
string
__toString()
Get the file content as a string.
at line 25
__construct(string $url, string|null $mimeType = null)
Create a new remote audio file.
at line 37
PendingTranscriptionGeneration
transcription()
Generate a transcription of the given audio.
at line 45
array
toArray()
Get the instance as an array.
at line 58
array
jsonSerialize()
Get the JSON serializable representation of the instance.