An event that triggers when an audio file has completed transcoding.
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.
function onAudioTranscoded(event: FileEvent): void;
The uploaded file information.
// Place this code in the events.js file
// of your site's Backend section.
export function wixMediaManager_onAudioTranscoded(event) {
let audioFileInfo = event.fileInfo;
let fileUrl = event.fileInfo.fileUrl;
let size = event.fileInfo.sizeInBytes;
}
/* Full event object:
* {
* "fileInfo": {
* "mediaType": "audio",
* "mimeType": "audio/mpeg",
* "sourceUrl": "https://somedomain.com/img/original-name.mp3",
* "fileUrl": "wix:audio://v1/2123bc_6aec991ee66c4c16a783433cc7dca232.mp3/fileUrl.mp3#"
* "hash": "5a9a91184e611dae3fed162b8787ce5f",
* "opStatus": "READY",
* "originalFileName": "original-name.mp3",
* "sizeInBytes": 8414449,
* "isPrivate": false
* },
* "context": {
* "someKey1": "someValue1",
* "someKey2": "someValue2"
* }
* }
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.