function drush_notify_send_audio

8.0.x notify.drush.inc drush_notify_send_audio($msg)
6.x notify.drush.inc drush_notify_send_audio($msg)
7.x notify.drush.inc drush_notify_send_audio($msg)
master notify.drush.inc drush_notify_send_audio($msg)

Send an audio-based system notification.

This function is only automatically invoked with the additional use of the --notify-audio flag or configuration state.

Parameters

$msg: Message for audio recital.

Return value

bool TRUE on success, FALSE on failure

1 call to drush_notify_send_audio()
drush_notify_send in commands/core/notify.drush.inc
Prepares and dispatches notifications to delivery mechanisms.

File

commands/core/notify.drush.inc, line 167
Add system notifications as a new drush option.

Code

function drush_notify_send_audio($msg) {
  $override = drush_get_option('notify-cmd-audio', FALSE);

  if (!empty($override)) {
    $cmd = $override;
  }
  else {
    switch (PHP_OS) {
      case 'Darwin':
        $cmd = 'say %s';
        break;
      case 'Linux':
      default:
        $cmd = drush_get_option('notify-cmd-audio', 'spd-say') . ' %s';
    }
  }

  if (!drush_shell_exec($cmd, $msg)) {
    return drush_set_error('NOTIFY_COMMAND_NOT_FOUND', dt('The third party notification utility failed.'));
  }
}