Track

create

Creates a new track

moises.track.create

Parameters

ParameterTypeDescription
groupIdstringThe ID of the group to add the track to
arrayBufferArrayBufferThe audio data for the track
namestringThe name of the track
ordernumberThe order of the track in the group
startPositionMsnumberThe start position of the track in milliseconds

Returns:

Promise<trackId> - Promise that resolves with the created track id

Example resolved value:

// When the promise resolves, you get:
trackid

Usage Example

import { initMoisesExtension } from '@moises.ai/extension'

const useMoisesExtension = initMoisesExtension({
  id: 'id',
  name: 'name',
  description: 'description',
  icon: 'icon',
  version: 'version',
  author: 'author'
})

const { moises } = useMoisesExtension()

const trackId = await moises.track.create({
  groupId: "group-123",
  arrayBuffer: new ArrayBuffer(1024),
  name: "My Track"
})

console.log(trackId) // "track-123"

This file is automatically generated. Do not edit manually.