Overview

Complete API reference for the documentation extension

Table of Contents


Audio Methods

Audio API for manipulating audio

audio.crop

Crops an audio

Parameters:

ParameterTypeDescription
inputArrayBufferThe audio buffer to crop
startTimenumberThe start time of the crop in seconds
endTimenumberThe end time of the crop in seconds

Returns:

Promise<ArrayBuffer> - Promise that resolves with the cropped audio buffer

Example resolved value:

// When the promise resolves, you get:
ArrayBuffer

audio.remove

Removes an audio segment

Parameters:

ParameterTypeDescription
inputArrayBufferThe audio buffer to remove
startTimenumberThe start time of the remove in seconds
endTimenumberThe end time of the remove in seconds

Returns:

Promise<ArrayBuffer> - Promise that resolves with the removed audio buffer

Example resolved value:

// When the promise resolves, you get:
ArrayBuffer

Usage Example:

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

audio.silence

Replaces an audio segment with silence

Parameters:

ParameterTypeDescription
inputArrayBufferThe audio buffer to replace with silence
startTimenumberThe start time of the silence in seconds
endTimenumberThe end time of the silence in seconds

Returns:

Promise<ArrayBuffer> - Promise that resolves with the audio buffer with silence

Example resolved value:

// When the promise resolves, you get:
ArrayBuffer

audio.hash

Computes the hash of an audio

Parameters:

ParameterTypeDescription
inputArrayBufferThe audio buffer to hash

Returns:

Promise<string> - Promise that resolves with the hash of the audio buffer

Example resolved value:

// When the promise resolves, you get:
"example"

Link API for managing extension links

link.trackContextMenu

Creates a context menu item for tracks

Parameters:

ParameterTypeDescription
labelstringDisplay label for the menu item
paramsObjectParameters passed to the onClick handler

Returns:

void - Does not return a value

Usage Example:

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

const useMoisesExtension = initMoisesExtension({
  id: 'my-extension',
  name: 'My Extension',
  description: 'Extension description',
  icon: 'icon',
  version: '1.0.0',
  author: 'author'
})

const { moises } = useMoisesExtension()

moises.link.trackContextMenu(
  { label: "Process Track" },
  ({ trackId }) => {
    console.log("Selected track:", trackId)
  }
)

link.singleTrackSelectionContextMenu

Creates a context menu item for single track selections

Parameters:

ParameterTypeDescription
labelstringDisplay label for the menu item
paramsObjectParameters passed to the onClick handler

Returns:

void - Does not return a value

Usage Example:

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

const useMoisesExtension = initMoisesExtension({
  id: 'my-extension',
  name: 'My Extension',
  description: 'Extension description',
  icon: 'icon',
  version: '1.0.0',
  author: 'author'
})

const { moises } = useMoisesExtension()

moises.link.singleTrackSelectionContextMenu(
  { label: "Process Selection" },
  ({ trackId, from, to }) => {
    console.log("Selected track:", trackId)
    console.log("Selection from:", from, "to:", to)
  }
)

link.toolbarButton

Creates a button in the toolbar

Parameters:

ParameterTypeDescription
labelstringDisplay label for the button
iconstringIcon identifier for the button
onClickFunctionCallback function triggered when button is clicked

Returns:

void - Does not return a value

Usage Example:

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

const useMoisesExtension = initMoisesExtension({
  id: 'my-extension',
  name: 'My Extension',
  description: 'Extension description',
  icon: 'icon',
  version: '1.0.0',
  author: 'author'
})

const { moises } = useMoisesExtension()

moises.link.toolbarButton(
  { label: "My Tool", icon: "tool-icon" },
  () => {
    console.log("Toolbar button clicked")
  }
)

link.footerButton

Creates a button in the footer

Parameters:

ParameterTypeDescription
labelstringDisplay label for the button
iconstringIcon identifier for the button
onClickFunctionCallback function triggered when button is clicked

Returns:

void - Does not return a value

Usage Example:

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

const useMoisesExtension = initMoisesExtension({
  id: 'my-extension',
  name: 'My Extension',
  description: 'Extension description',
  icon: 'icon',
  version: '1.0.0',
  author: 'author'
})

const { moises } = useMoisesExtension()

moises.link.footerButton(
  { label: "Footer Action", icon: "action-icon" },
  () => {
    console.log("Footer button clicked")
  }
)

Analyzer Methods

Analyzer API for managing audio analyzers

analyzer.create

Creates and attaches a new audio analyzer

Parameters:

ParameterTypeRequiredDescription
fftSizenumberYesFFT size for frequency analysis (must be power of 2)
smoothingTimeConstantnumberYesSmoothing time constant for frequency data
minDecibelsnumberYesMinimum decibel value for frequency data
maxDecibelsnumberYesMaximum decibel value for frequency data
typestringYesType of analyzer
purposestringNoPurpose description for the analyzer

Returns:

Promise<Object> - Promise that resolves with analyzer info

Return Object Structure:

// When the promise resolves, you get:
{
  id: "example" // string
}

Usage Example:

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

const useMoisesExtension = initMoisesExtension({
  id: 'my-extension',
  name: 'My Extension',
  description: 'Extension description',
  icon: 'icon',
  version: '1.0.0',
  author: 'author'
})

const { moises } = useMoisesExtension()

const analyzer = await moises.analyzer.create({
  fftSize: 2048,
  smoothingTimeConstant: 0.8,
  minDecibels: -90,
  maxDecibels: -10
})
console.log('Analyzer created:', analyzer.id)

analyzer.detach

Detaches and removes an analyzer

Parameters:

ParameterTypeDescription
analyzerIdstringThe ID of the analyzer to detach

Returns:

Promise<boolean> - Promise that resolves with success status

Example resolved value:

// When the promise resolves, you get:
false

Usage Example:

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

const useMoisesExtension = initMoisesExtension({
  id: 'my-extension',
  name: 'My Extension',
  description: 'Extension description',
  icon: 'icon',
  version: '1.0.0',
  author: 'author'
})

const { moises } = useMoisesExtension()

const success = await moises.analyzer.detach('analyzer-id')
console.log('Analyzer detached:', success)

analyzer.get

Gets information about a specific analyzer

Parameters:

ParameterTypeDescription
analyzerIdstringThe ID of the analyzer to get

Returns:

Object | unknown - Analyzer information or null if not found

Usage Example:

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

const useMoisesExtension = initMoisesExtension({
  id: 'my-extension',
  name: 'My Extension',
  description: 'Extension description',
  icon: 'icon',
  version: '1.0.0',
  author: 'author'
})

const { moises } = useMoisesExtension()

const analyzerInfo = moises.analyzer.get('analyzer-id')
console.log('Analyzer info:', analyzerInfo)

analyzer.list

Lists all attached analyzers

Parameters:

ParameterTypeDescription
None--

Returns:

Array - Array of attached analyzer information

Usage Example:

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

const useMoisesExtension = initMoisesExtension({
  id: 'my-extension',
  name: 'My Extension',
  description: 'Extension description',
  icon: 'icon',
  version: '1.0.0',
  author: 'author'
})

const { moises } = useMoisesExtension()

const analyzers = moises.analyzer.list()
console.log('Attached analyzers:', analyzers)

analyzer.getData

Gets serialized analyzer data that can be safely passed through postMessage

Parameters:

ParameterTypeDescription
analyzerIdstringThe ID of the analyzer to get data from

Returns:

Object - Serialized analyzer data including frequency and waveform data

Usage Example:

const analyzerData = moises.analyzer.getData('analyzer-id')
console.log(analyzerData.frequencyData) // Array of frequency values
console.log(analyzerData.waveformData) // Array of waveform values

UI Methods

Controlling common UI elements

ui.setPluginSize

Sets the size of the extension plugin

Parameters:

ParameterTypeDescription
widthnumberThe width of the plugin in pixels
heightnumberThe height of the plugin in pixels

Returns:

void - Does not return a value

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()

moises.ui.setPluginSize({ width: 800, height: 600 })

ui.filePicker

Displays a file picker dialog

Parameters:

ParameterTypeRequiredDescription
titlestringNoFile picker title
descriptionstringNoFile picker description

Returns:

Promise<ArrayBuffer> - Promise that resolves with the selected file data

Example resolved value:

// When the promise resolves, you get:
ArrayBuffer

ui.progress

Displays a progress bar or loading indicator

Parameters:

ParameterTypeRequiredDescription
titlestringNoProgress title
valuenumberNoProgress value (0-100)

Returns:

Promise<void> - Promise that resolves when the operation is complete

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()

await moises.ui.progress({ title: "Loading...", value: 50 })

ui.cancel

Cancels the current UI operation

Parameters:

ParameterTypeDescription
None--

Returns:

Promise<void> - Promise that resolves when the operation is cancelled


ui.alert

Displays an alert to the user

Parameters:

ParameterTypeRequiredDescription
titlestringNoAlert title
descriptionstringNoAlert description
ctaLabelstringNoAlert CTA label
ctaColorstringNoAlert CTA color

Returns:

Promise<void> - Promise that resolves when the alert is closed

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()

await moises.ui.alert({ title: "Notice", description: "Operation completed!", ctaLabel: "OK", ctaColor: "primary" })

ui.confirm

Displays a confirmation dialog

Parameters:

ParameterTypeRequiredDescription
titlestringYesConfirmation title
descriptionstringYesConfirmation description
ctaLabelstringNoConfirmation CTA label
ctaColorstringNoConfirmation CTA color

Returns:

Promise<boolean> - Promise that resolves with true if confirmed, false if cancelled

Example resolved value:

// When the promise resolves, you get:
false

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 confirmed = await moises.ui.confirm({
  title: "Confirm",
  description: "Do you want to continue?",
})

ui.prompt

Displays a text input dialog

Parameters:

ParameterTypeRequiredDescription
titlestringYesPrompt title
descriptionstringYesPrompt description
labelstringNoPrompt label
defaultValuestringNoPrompt default value
ctaLabelstringNoPrompt CTA label
ctaColorstringNoPrompt CTA color

Returns:

Promise<string> - Promise that resolves with the entered text

Example resolved value:

// When the promise resolves, you get:
"example"

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 userInput = await moises.ui.prompt({
  title: "Name",
  description: "Enter your name:",
  label: "Name",
  defaultValue: "John Doe",
  ctaLabel: "OK",
  ctaColor: "primary"
})

ui.close

Closes the extension

Parameters:

ParameterTypeDescription
None--

Returns:

Promise<void> - Promise that resolves when the extension is closed

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()

await moises.ui.close()

ui.open

Opens the extension

Parameters:

ParameterTypeRequiredDefaultDescription
mountPointstringYes"sidePanelbottomPanel"

Returns:

Promise<void> - Promise that resolves when the extension is opened

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()

await moises.ui.open()

Session Methods

Session API for managing audio sessions, tracks, and playback controls

session.export

Exports the audio from the current session

Parameters:

ParameterTypeDescription
None--

Returns:

Promise<ArrayBuffer> - Promise that resolves with the exported audio data

Example resolved value:

// When the promise resolves, you get:
ArrayBuffer

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 audioData = await moises.session.export()

session.tracks

Gets the list of tracks from the session

Parameters:

ParameterTypeDescription
None--

Returns:

Promise<Array<Object>> - Promise that resolves with an array of tracks

Example resolved value:

// When the promise resolves, you get:
Object[]

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 tracks = await moises.session.tracks()
console.log(tracks.length) // number of tracks

session.play

Starts session playback

Parameters:

ParameterTypeDescription
None--

Returns:

void - Does not return a value

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()

await moises.session.play()

session.pause

Pauses session playback

Parameters:

ParameterTypeDescription
None--

Returns:

void - Does not return a value

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()

await moises.session.pause()

session.togglePlayback

Toggles between play and pause

Parameters:

ParameterTypeDescription
None--

Returns:

void - Does not return a value

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()

await moises.session.togglePlayback()

session.clearSelection

Clears the current selection in the session

Parameters:

ParameterTypeDescription
None--

Returns:

void - Does not return a value

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()

await moises.session.clearSelection()

session.setSelection

Sets a selection in the session

Parameters:

ParameterTypeRequiredDescription
trackIdstringNoID of the track to be selected
startnumberYesStart position of the selection
endnumberYesEnd position of the selection

Returns:

void - Does not return a value

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()

await moises.session.setSelection({
  trackId: "track-123",
  start: 0,
  end: 30
})

// Selects an interval without specifying a track
await moises.session.setSelection({ start: 10, end: 20 })

session.reset

This method performs a complete reset of the DAW session by:Use this method when you need to start with a clean slate or prepare the session for loading new content.

Parameters:

ParameterTypeDescription
None--

Returns:

void - Does not return a value

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()

// Reset the entire DAW session
moises.session.reset()
console.log('Session has been reset')
// Reset before loading a new project
moises.session.reset()

session.getState

Gets the current state of the session

Parameters:

ParameterTypeDescription
None--

Returns:

Object - Current session state

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 sessionState = moises.session.getState()
console.log(`Current time: ${sessionState.currentTime}s`)
console.log(`Duration: ${sessionState.duration}s`)
console.log(`Master volume: ${sessionState.masterVolume}`)

Track Methods

Track API for managing audio tracks

track.getArrayBuffer

Gets the array buffer for a track by its ID

Parameters:

ParameterTypeDescription
trackIdstringThe ID of the track to get the array buffer for

Returns:

ArrayBuffer - The array buffer containing the track's audio data

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 arrayBuffer = await moises.track.getArrayBuffer({ trackId: 'track-123' })
console.log(arrayBuffer) // ArrayBuffer

track.get

Gets a track by its ID

Parameters:

ParameterTypeDescription
trackIdstringThe ID of the track to get

Returns:

Promise<Object> - Promise that resolves with the track object

Return Object Structure:

// When the promise resolves, you get:
{
  id: "example", // string
  groupId: "example", // string
  name: "example", // string
  position: 0, // number
  pan: 0, // number
  volume: 0, // number
  isSolo: false, // boolean
  isMuted: false, // boolean
  duration: 0, // number
  loading: false, // boolean
  isStitched: false // boolean
}

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 track = await moises.track.get({ trackId: 'track-123' })
console.log(track.name) // "My Track"

track.list

Gets a list of all tracks in the session

Parameters:

ParameterTypeDescription
None--

Returns:

Promise<Array<Object>> - Promise that resolves with an array of track objects

Example resolved value:

// When the promise resolves, you get:
Object[]

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 tracks = await moises.track.list()
console.log(tracks.length) // number of tracks

track.create

Creates a new track

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"

track.update

Updates a track

Parameters:

ParameterTypeRequiredDescription
trackIdstringYesThe ID of the track to update
arrayBufferArrayBufferNoThe audio data for the track
groupIdstringNoThe ID of the group to move the track to
namestringNoThe name of the track
mutedbooleanNoWhether the track is muted
loadingbooleanNoWhether the track is loading
volumenumberNoThe volume of the track (0-1)
pannumberNoThe pan of the track (-1 to 1)
startPositionMsnumberNoThe start position of the track in milliseconds

Returns:

Promise<void> - Promise that resolves when the track is updated

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()

await moises.track.update({
  trackId: "track-123",
  arrayBuffer: new ArrayBuffer(1024),
  groupId: "group-456",
  name: "Updated Track Name",
  muted: true
})

track.delete

Deletes a track

Parameters:

ParameterTypeDescription
trackIdstringThe ID of the track to delete

Returns:

Promise<void> - Promise that resolves with the deleted track object

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()

await moises.track.delete({ trackId: "track-123" })

Group Methods

Group API for managing audio groups

group.get

Gets a group by its ID

Parameters:

ParameterTypeDescription
groupIdstringThe ID of the group to get

Returns:

Promise<Object> - Promise that resolves with the group object

Return Object Structure:

// When the promise resolves, you get:
{
  id: "example", // string
  type: "example", // string
  name: "example", // string
  volume: 0, // number
  isSolo: false, // boolean
  isMuted: false, // boolean
  tracks: string[] // Array<string>
}

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 group = await moises.group.get({ groupId: 'group-123' })
console.log(group.name) // "My Group"

group.list

Gets a list of all groups in the session

Parameters:

ParameterTypeDescription
None--

Returns:

Promise<Array<Object>> - Promise that resolves with an array of group objects

Example resolved value:

// When the promise resolves, you get:
Object[]

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 groups = await moises.group.list()
console.log(groups.length) // number of groups

group.create

Creates a new group

Parameters:

ParameterTypeDescription
namestringThe name of the group
idstringThe ID of the group
typestringThe type of the group
ordernumberThe order of the group
solobooleanWhether the group is solo
mutedbooleanWhether the group is muted
pannumberThe pan of the group
volumenumberThe volume of the group
optionsObjectAdditional options for the group

Returns:

Promise<Object> - Promise that resolves with the created group object

Return Object Structure:

// When the promise resolves, you get:
{
  groupId: "example" // string
}

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 groupId = await moises.group.create({ name: "My Group" })
console.log(groupId) // "group-123"

group.update

Updates a group

Parameters:

ParameterTypeRequiredDescription
groupIdstringYesThe ID of the group to update
namestringNoThe name of the group
typestringNoThe type of the group
ordernumberNoThe order of the group
solobooleanNoWhether the group is solo
mutedbooleanNoWhether the group is muted
volumenumberNoThe volume of the group (0-1)
takeLaneSetupArrayNoThe take lane setup configuration for the group

Returns:

Promise<void> - Promise that resolves when the group is updated

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()

await moises.group.update({
  groupId: "group-123",
  name: "Updated Group Name",
  muted: true,
  volume: 0.8
})

Storage Methods

Storage API for managing audio files

storage.upload

Uploads a buffer to the storage

Parameters:

ParameterTypeDescription
bufferArrayBufferThe audio data to upload

Returns:

Promise<Object> - Promise that resolves with the uploaded audio data

Return Object Structure:

// When the promise resolves, you get:
{
  url: "example" // string
}

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 url = await moises.storage.upload({ buffer: new ArrayBuffer(1024) })
console.log(url) // "https://storage.com/audio.mp3"

storage.download

Downloads an audio file from the storage

Parameters:

ParameterTypeDescription
urlstringThe URL of the audio file to download

Returns:

Promise<ArrayBuffer> - Promise that resolves with the downloaded audio data

Example resolved value:

// When the promise resolves, you get:
ArrayBuffer

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 buffer = await moises.storage.download({ url: "https://storage.com/audio.mp3" })
console.log(buffer) // ArrayBuffer

Storage Methods

if showed alert before, shows new alert only last day

storage.upload

Uploads a buffer to the storage

Parameters:

ParameterTypeDescription
bufferArrayBufferThe audio data to upload

Returns:

Promise<Object> - Promise that resolves with the uploaded audio data

Return Object Structure:

// When the promise resolves, you get:
{
  url: "example" // string
}

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 url = await moises.storage.upload({ buffer: new ArrayBuffer(1024) })
console.log(url) // "https://storage.com/audio.mp3"

storage.download

Downloads an audio file from the storage

Parameters:

ParameterTypeDescription
urlstringThe URL of the audio file to download

Returns:

Promise<ArrayBuffer> - Promise that resolves with the downloaded audio data

Example resolved value:

// When the promise resolves, you get:
ArrayBuffer

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 buffer = await moises.storage.download({ url: "https://storage.com/audio.mp3" })
console.log(buffer) // ArrayBuffer

UploadToSignedUrl Methods

Uploads an array buffer to a pre-signed URL

Compute Methods

Compute API for managing audio computations

compute.sessionPlayerGenerate

Generates a session player

Parameters:

ParameterTypeDescription
contextAudioArrayBufferThe context audio for the session player
conditioningAudioArrayBufferThe conditioning audio for the session player
conditioningTextstringThe conditioning text for the session player
stepsnumberThe number of steps for the session player
guidanceScalenumberThe guidance scale for the session player
weightSchedulenumberThe weight schedule for the session player
instrumentstringThe instrument for the session player
presetIdstringThe preset ID for the session player
chromabooleanWhether to use chroma for the session player
inpaintingTimestampsArrayThe timestamps for the session player
inpaintingTargetArrayThe target for the session player

Returns:

Promise<Object> - Promise that resolves with the generated session player

Return Object Structure:

// When the promise resolves, you get:
{
  conditioningAudio: ArrayBuffer, // ArrayBuffer
  conditioningText: "example", // string
  contextAudio: ArrayBuffer, // ArrayBuffer
  generatedAudio: ArrayBuffer, // ArrayBuffer
  generatedAudio2: ArrayBuffer, // ArrayBuffer
  guidanceScale: 0, // number
  seed: 0, // number
  steps: 0, // number
  weightSchedule: "example" // string
}

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()

await moises.compute.sessionPlayerGenerate({})

compute.sessionPlayerPresets

Gets the list of session player presets

Parameters:

ParameterTypeDescription
None--

Returns:

void - Does not return a value

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 presets = await moises.compute.sessionPlayerPresets()
console.log(presets) // [{ id: 'preset-123', name: 'Preset 1', description: 'Description 1', image: 'https://storage.com/image.png', instrument: 'Instrument 1' }]

compute.sessionPlayerInpaint

Inpaints an audio file

Parameters:

ParameterTypeDescription
inputArrayBufferThe input audio data
maskArrayBufferThe mask for the inpainting

Returns:

Promise<Object> - Promise that resolves with the inpainted audio data TODO: add return type

Return Object Structure:

// When the promise resolves, you get:
{}

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 inpainted = await moises.compute.sessionPlayerInpaint({ input, mask })
console.log(inpainted) // ArrayBuffer

compute.workflow

Runs a workflow

Parameters:

ParameterTypeDescription
workflowIdstringThe ID of the workflow to run
paramsObjectThe parameters for the workflow

Returns:

Promise<Object> - Promise that resolves with the workflow result

Return Object Structure:

// When the promise resolves, you get:
{
  detection: "example" // string
}

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 params = {
  inputUrl: 'https://storage.com/audio.mp3',
}

const workflowId = 'workflow'

const result = await moises.compute.workflow({ workflowId, params })
console.log(result) // { detection: 'detection' }

compute.automix

Runs an automix job

Parameters:

ParameterTypeDescription
workflowIdstringThe ID of the workflow to run
paramsObjectThe parameters for the workflow

Returns:

Promise<Object> - Promise that resolves with the automix result

Return Object Structure:

// When the promise resolves, you get:
{
  mix: "example" // string
}

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 params = {
  inputUrl: 'https://storage.com/audio.mp3',
}

const workflowId = 'automix'

const result = await moises.compute.automix({ workflowId, params })
console.log(result) // { mix: 'mix' }

compute.stems

Extracts stems from an audio file

Parameters:

ParameterTypeDescription
inputstringThe input audio data
stemsToExtractArrayThe stems to extract

Returns:

Promise<Object> - Promise that resolves with the stems

Return Object Structure:

// When the promise resolves, you get:
{
  stem.id: "example" // string
}

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 params = {
  inputUrl: 'https://storage.com/audio.mp3',
  vocals: true,
  drums: true,
  bass: false,
  guitars: false,
  strings: false,
  piano: false,
  keys: false
}

const result = await moises.compute.stems(params)
console.log(result) // { stems.vocals: string, stems.drums: string }

compute.instruments

Detects instruments in an audio file

Parameters:

ParameterTypeDescription
inputUrlstringThe input audio data

Returns:

Promise<Object> - Promise that resolves with the instruments result

Return Object Structure:

// When the promise resolves, you get:
{
  instruments: "example" // string
}

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 result = await moises.compute.instruments({ input })
console.log(result) // { instruments: 'instrument' }

compute.beatsAndChords

Detects beats and chords in an audio file

Parameters:

ParameterTypeDescription
inputstringThe input audio data

Returns:

Promise<Object> - Promise that resolves with the beats and chords result

Return Object Structure:

// When the promise resolves, you get:
{
  beatMap: object, // object
  chordMap: object, // object
  bpm: 0, // number
  rootKey: "example", // string
  detuningCents: 0, // number
  estimatedTuning: "example" // string
}

compute.beats

Detects beats in an audio file

Parameters:

ParameterTypeDescription
inputstringThe input audio data

Returns:

Promise<void> - Promise that resolves with the beats result

Usage Example:

const result = await compute.beats({ input })

compute.lyrics

Detects lyrics in an audio file

Parameters:

ParameterTypeDescription
inputstringThe input audio data

Returns:

Promise<void> - Promise that resolves with the lyrics result

Usage Example:

const result = await compute.lyrics({ input })

Now Methods

in some cases, date 'now' is in the future. prevent to show countdown in this case

SetShowed Methods

show alert

Today Methods

if expired, dismiss alert

GA4 Methods

GA4 Methods

GA4 Methods


This file is automatically generated. Do not edit manually.