AudioToolDeps
@forge/monorepo / backend/src / AudioToolDeps
Type Alias: AudioToolDeps
AudioToolDeps =
object
Defined in: backend/src/tools/library/audio.ts:64
What the tool needs in order to read an uploaded file and write a generated one.
Properties
bounds?
readonlyoptionalbounds?:AudioBounds
Defined in: backend/src/tools/library/audio.ts:84
readFile
readonlyreadFile: (fileId) =>Promise<{bytes:Uint8Array;byteSize:number;filename?:string;mediaType:string; }>
Defined in: backend/src/tools/library/audio.ts:72
Reads an uploaded file's bytes through the authorized path.
A function rather than a store, because the tool must not be able to reach a file the principal cannot: the host supplies a reader already scoped to the execution context, which is the same arrangement the attachment bridge uses.
Parameters
fileId
string
Returns
Promise<{ bytes: Uint8Array; byteSize: number; filename?: string; mediaType: string; }>
writeAudio
readonlywriteAudio: (input) =>Promise<{fileId:string;url?:string; }>
Defined in: backend/src/tools/library/audio.ts:79
Stores generated audio and returns what a client needs to play it.
Parameters
input
bytes
Uint8Array
filename
string
mediaType
string
Returns
Promise<{ fileId: string; url?: string; }>