Module record

Record sound from a channel.

This module provides actions which deal with recording sound from a channel.

Info:

  • Copyright: 2011-2015 Chad Phillips
  • Author: Chad Phillips

Actions

record Record sound from a channel.
record_merge Merge two recordings.

Handlers

file The file handler (default).

Tables

last_recording Last recording storage.


Actions

record
Record sound from a channel.

The recording is in .wav format.

  • action string record
  • append bool (Optional) Append the recording to an existing file. Requires that the 'filename' parameter be set. If the named file does not exist, then it will be created. Default is false.
  • filename string (Optional) The name of the recorded file. Defaults to '%Y-%m-%d_%H:%M:%S-${uuid}.wav'.
  • keys tab (Optional) See Capturing user key input.
  • location string (Optional) Where to store the file. Default is '/tmp'.
  • max_length int (Optional) Maximum allowed length of the recording in seconds. Default is 180.
  • pre_record_delay int (Optional) Set to the number of milliseconds to delay just prior to beginning the recording. This happens after the 'pre_record_sound' is played. This can be useful to tweak if trailing channel sounds are being recording at the beginning of the recording. Set to 0 for no delay. Default is 200 milliseconds.
  • pre_record_sound string (Optional) Set to a file or phrase to play prior to beginning the recording, or to 'tone' to play a typical 'wait for the beep' tone. Default is to do nothing.
  • silence_secs int (Optional) The number of consecutive seconds of silence to wait before considering the recording finished. Default is 5.
  • silence_threshold int (Optional) A number indicating the threshhold for what is considered silence. Higher numbers mean more noise will be tolerated. Default is 20.
  • storage_area string (Optional) If set the last_recording storage values are also stored in this storage area with the 'last_recording_' prefix stripped, eg. 'storage_area = "message"' would store 'name' in the 'message' storage area with the same value as 'last_recording_name'.
  • handler string The handler to use, see handlers. If not specified, defaults to the default handler for the module.

Usage:

    {
      action = "record",
      append = false,
      filename = greeting .. ".tmp.wav",
      keys = {
        ["#"] = ":break",
      },
      location = "/tmp",
      max_length = profile.max_greeting_length,
      pre_record_delay = 200,
      pre_record_sound = "phrase:beep",
      silence_secs = profile.recording_silence_end,
      silence_threshold = profile.recording_silence_threshold,
      storage_area = "record_greeting",
    }
record_merge
Merge two recordings.

This action merges two recorded files into one. The merge file may be appended or prepended to the base file.

  • action string record_merge
  • base_file string Full path to the base file for the merge. The will be the file that remains after the merge.
  • merge_file string Full path to the merge file for the merge. This file will not longer exist after the merge.
  • merge_type string (Optional) The type of merge to perform, valid values are 'append' and 'prepend'. Default is 'append'.
  • handler string The handler to use, see handlers. If not specified, defaults to the default handler for the module.

Usage:

    {
      action = "record_merge",
      base_file = "storage/greeting.wav",
      merge_file = "/tmp/preroll.wav",
      merge_type = "prepend",
    }

Handlers

file
The file handler (default).

The default handler for the record module, operates on files on the local filesystem.

Usage:

    {
      action = "record",
      handler = "file",
      -- other params...
    }

Tables

last_recording
Last recording storage.

The following variables/values related to the recording are put into the Jester 'record' storage area upon completion of the recording. The fields described are the storage keys.

Fields:

  • last_recording_name The name of the recording.
  • last_recording_path A full path to the recording.
  • last_recording_timestamp The UNIX timestamp of the recording (when it began).
  • last_recording_duration The duration of the recording in seconds.
generated by LDoc 1.4.6 Last updated 2021-04-08 08:59:59