RecorderManager.pause(params: Object)

Requires:
BaseKit≥2.3.2
Platforms:
iOSAndroid

Description

Pause recording

Parameters

PropertyTypeRequiredDescription
complete() => voidNoCompletion callback (executed on both success and failure)
success(params: Object) => voidNoCallback on successful API call
fail(params: Object) => voidNoFailure callback
success callback parameters
PropertyTypeDescriptionSince
tempFilePathstringTemporary path of the recording file (local path)v3.2.6
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

import { getRecorderManager } from '@ray-js/ray'

const manager = await getRecorderManager();

// Start recording first to ensure a pausable recording context, then call pause.
manager.start({
  duration: 60000,
  sampleRate: 8000,
  numberOfChannels: 2,
  encodeBitRate: 48000,
  format: "aac",
  frameSize: 1,
  audioSource: "auto",
  success: () => {
    manager.pause({
      success: data => {
        console.log(data);
        // Cleanup: stop recording after a successful pause to avoid affecting subsequent cases.
        manager.stop({ success: () => {}, fail: () => {} });
      },
      fail: error => {
        console.error(error);
      },
    });
  },
  fail: error => {
    console.error(error);
  },
});