Search.../

onAudioTranscoded( )

An event that triggers when an audio file has completed transcoding.

Description

The onAudioTranscoded() event handler runs when an uploaded audio file has finished transcoding. Audio files that have been imported aren't immediately available until the transcoding has completed.

It is fired after the onFileUploaded event, and after the transcoding has completed. The FileEvent object contains information about the uploaded audio file and the upload context.

Note: Backend events don't work when previewing your site.

Syntax

function onAudioTranscoded(event: FileEvent): void

onAudioTranscoded Parameters

NAME
TYPE
DESCRIPTION
event
FileEvent

The uploaded file information.

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

An event when an audio file has been transcoded

Copy Code
1// Place this code in the events.js file
2// of your site's Backend section.
3
4export function wixMediaManager_onAudioTranscoded(event) {
5 let audioFileInfo = event.fileInfo;
6 let fileUrl = event.fileInfo.fileUrl;
7 let size = event.fileInfo.sizeInBytes;
8}
9
10/* Full event object:
11* {
12* "fileInfo": {
13* "mediaType": "audio",
14* "mimeType": "audio/mpeg",
15* "sourceUrl": "https://somedomain.com/img/original-name.mp3",
16* "fileUrl": "wix:audio://v1/2123bc_6aec991ee66c4c16a783433cc7dca232.mp3/fileUrl.mp3#"
17* "hash": "5a9a91184e611dae3fed162b8787ce5f",
18* "opStatus": "READY",
19* "originalFileName": "original-name.mp3",
20* "sizeInBytes": 8414449,
21* "isPrivate": false
22* },
23* "context": {
24* "someKey1": "someValue1",
25* "someKey2": "someValue2"
26* }
27* }
28*/