Описание класса AlisaSound | Universal Bot

AlisaSound extends TemplateSoundTypes

Класс отвечающий за воспроизведение звуков в Алисе.

Class AlisaSound

Table of Contents

S_EFFECT_BEHIND_THE_WALL '<speaker effect="behind_the_wall">'
S_EFFECT_HAMSTER '<speaker effect="hamster">'
S_EFFECT_MEGAPHONE '<speaker effect="megaphone">'
S_EFFECT_PITCH_DOWN '<speaker effect="pitch_down">'
S_EFFECT_PSYCHODELIC '<speaker effect="psychodelic">'
S_EFFECT_PULSE '<speaker effect="pulse">'
S_EFFECT_TRAIN_ANNOUNCE '<speaker effect="train_announce">'
S_EFFECT_END '<speaker effect="-">'
S_AUDIO_GAME_BOOT '#$game_boot$#'
S_AUDIO_GAME_8_BIT_COIN '#$game_coin$#'
S_AUDIO_GAME_LOSS '#$game_loss$#'
S_AUDIO_GAME_PING '#$game_ping$#'
S_AUDIO_GAME_WIN '#$game_win$#'
S_AUDIO_GAME_8_BIT_FLYBY '#$game_fly$#'
S_AUDIO_GAME_8_BIT_MACHINE_GUN '#$game_gun$#'
S_AUDIO_GAME_8_BIT_PHONE '#$games_phone$#'
S_AUDIO_GAME_POWERUP '#$games_powerup$#'
S_AUDIO_NATURE_WIND '#$nature_wind$#'
S_AUDIO_NATURE_THUNDER '#$nature_thunder$#'
S_AUDIO_NATURE_JUNGLE '#$nature_jungle$#'
S_AUDIO_NATURE_RAIN '#$nature_rain$#'
S_AUDIO_NATURE_FOREST '#$nature_forest$#'
S_AUDIO_NATURE_SEA '#$nature_sea$#'
S_AUDIO_NATURE_FIRE '#$nature_fire$#'
S_AUDIO_NATURE_STREAM '#$nature_stream$#'
$isUsedStandardSound Использование стандартных звуков. bool
$standardSounds Стандартные звуки. array[]
getPause() Получение разметки для вставки паузы между словами. string
getSounds() Получение корректно составленного текста, в котором все ключи заменены на соответствующие звуки. string
replaceSound() Замена ключей в тексте на соответствующие им звуки. string
removeSound() Удаление любых звуков и эффектов из текста. string
getSounds() Получение звуков, которые необходимо воспроизвести или отправить. mixed

Constants

S_EFFECT_BEHIND_THE_WALL

mixed $S_EFFECT_BEHIND_THE_WALL = '<speaker effect="behind_the_wall">'

S_EFFECT_HAMSTER

mixed $S_EFFECT_HAMSTER = '<speaker effect="hamster">'

S_EFFECT_MEGAPHONE

mixed $S_EFFECT_MEGAPHONE = '<speaker effect="megaphone">'

S_EFFECT_PITCH_DOWN

mixed $S_EFFECT_PITCH_DOWN = '<speaker effect="pitch_down">'

S_EFFECT_PSYCHODELIC

mixed $S_EFFECT_PSYCHODELIC = '<speaker effect="psychodelic">'

S_EFFECT_PULSE

mixed $S_EFFECT_PULSE = '<speaker effect="pulse">'

S_EFFECT_TRAIN_ANNOUNCE

mixed $S_EFFECT_TRAIN_ANNOUNCE = '<speaker effect="train_announce">'

S_EFFECT_END

mixed $S_EFFECT_END = '<speaker effect="-">'

S_AUDIO_GAME_BOOT

mixed $S_AUDIO_GAME_BOOT = '#$game_boot$#'

S_AUDIO_GAME_8_BIT_COIN

mixed $S_AUDIO_GAME_8_BIT_COIN = '#$game_coin$#'

S_AUDIO_GAME_LOSS

mixed $S_AUDIO_GAME_LOSS = '#$game_loss$#'

S_AUDIO_GAME_PING

mixed $S_AUDIO_GAME_PING = '#$game_ping$#'

S_AUDIO_GAME_WIN

mixed $S_AUDIO_GAME_WIN = '#$game_win$#'

S_AUDIO_GAME_8_BIT_FLYBY

mixed $S_AUDIO_GAME_8_BIT_FLYBY = '#$game_fly$#'

S_AUDIO_GAME_8_BIT_MACHINE_GUN

mixed $S_AUDIO_GAME_8_BIT_MACHINE_GUN = '#$game_gun$#'

S_AUDIO_GAME_8_BIT_PHONE

mixed $S_AUDIO_GAME_8_BIT_PHONE = '#$games_phone$#'

S_AUDIO_GAME_POWERUP

mixed $S_AUDIO_GAME_POWERUP = '#$games_powerup$#'

S_AUDIO_NATURE_WIND

mixed $S_AUDIO_NATURE_WIND = '#$nature_wind$#'

S_AUDIO_NATURE_THUNDER

mixed $S_AUDIO_NATURE_THUNDER = '#$nature_thunder$#'

S_AUDIO_NATURE_JUNGLE

mixed $S_AUDIO_NATURE_JUNGLE = '#$nature_jungle$#'

S_AUDIO_NATURE_RAIN

mixed $S_AUDIO_NATURE_RAIN = '#$nature_rain$#'

S_AUDIO_NATURE_FOREST

mixed $S_AUDIO_NATURE_FOREST = '#$nature_forest$#'

S_AUDIO_NATURE_SEA

mixed $S_AUDIO_NATURE_SEA = '#$nature_sea$#'

S_AUDIO_NATURE_FIRE

mixed $S_AUDIO_NATURE_FIRE = '#$nature_fire$#'

S_AUDIO_NATURE_STREAM

mixed $S_AUDIO_NATURE_STREAM = '#$nature_stream$#'

Properties

$isUsedStandardSound

Использование стандартных звуков.

public bool $isUsedStandardSound = true
True - используются стандартные звуки.

$standardSounds

Стандартные звуки.

protected array[] $standardSounds = [['key' => '#$game_win$#', 'sounds' => ['<speaker audio="alice-sounds-game-win-1.opus">', '<speaker audio="alice-sounds-game-win-2.opus">', '<speaker audio="alice-sounds-game-win-3.opus">']], ['key' => '#$game_loss$#', 'sounds' => ['<speaker audio="alice-sounds-game-loss-1.opus">', '<speaker audio="alice-sounds-game-loss-2.opus">', '<speaker audio="alice-sounds-game-loss-3.opus">']], ['key' => '#$game_boot$#', 'sounds' => ['<speaker audio="alice-sounds-game-boot-1.opus">']], ['key' => '#$game_coin$#', 'sounds' => ['<speaker audio="alice-sounds-game-8-bit-coin-1.opus">', '<speaker audio="alice-sounds-game-8-bit-coin-2.opus">']], ['key' => '#$game_ping$#', 'sounds' => ['<speaker audio="alice-sounds-game-ping-1.opus">']], ['key' => '#$game_fly$#', 'sounds' => ['<speaker audio="alice-sounds-game-8-bit-flyby-1.opus">']], ['key' => '#$game_gun$#', 'sounds' => ['<speaker audio="alice-sounds-game-8-bit-machine-gun-1.opus">']], ['key' => '#$game_phone$#', 'sounds' => ['<speaker audio="alice-sounds-game-8-bit-phone-1.opus">']], ['key' => '#$game_powerup$#', 'sounds' => ['<speaker audio="alice-sounds-game-powerup-1.opus">', '<speaker audio="alice-sounds-game-powerup-2.opus">']], ['key' => '#$nature_wind$#', 'sounds' => ['<speaker audio="alice-sounds-nature-wind-1.opus">', '<speaker audio="alice-sounds-nature-wind-2.opus">']], ['key' => '#$nature_thunder$#', 'sounds' => ['<speaker audio="alice-sounds-nature-thunder-1.opus">', '<speaker audio="alice-sounds-nature-thunder-2.opus">']], ['key' => '#$nature_jungle$#', 'sounds' => ['<speaker audio="alice-sounds-nature-jungle-1.opus">', '<speaker audio="alice-sounds-nature-jungle-2.opus">']], ['key' => '#$nature_rain$#', 'sounds' => ['<speaker audio="alice-sounds-nature-rain-1.opus">', '<speaker audio="alice-sounds-nature-rain-2.opus">']], ['key' => '#$$#', 'sounds' => ['<speaker audio="alice-sounds-nature-forest-1.opus">', '<speaker audio="alice-sounds-nature-forest-2.opus">']], ['key' => '#$nature_sea$#', 'sounds' => ['<speaker audio="alice-sounds-nature-sea-1.opus">', '<speaker audio="alice-sounds-nature-sea-2.opus">']], ['key' => '#$nature_fire$#', 'sounds' => ['<speaker audio="alice-sounds-nature-fire-1.opus">', '<speaker audio="alice-sounds-nature-fire-2.opus">']], ['key' => '#$nature_stream$#', 'sounds' => ['<speaker audio="alice-sounds-nature-stream-1.opus">', '<speaker audio="alice-sounds-nature-stream-2.opus">']], ['key' => '#$thing_chainsaw$#', 'sounds' => ['<speaker audio="alice-sounds-things-chainsaw-1.opus">', '<speaker audio="alice-sounds-things-explosion-1.opus">', '<speaker audio="alice-sounds-things-water-3.opus">', '<speaker audio="alice-sounds-things-water-1.opus">', '<speaker audio="alice-sounds-things-water-2.opus">', '<speaker audio="alice-sounds-things-switch-1.opus">', '<speaker audio="alice-sounds-things-switch-2.opus">', '<speaker audio="alice-sounds-things-gun-1.opus">', '<speaker audio="alice-sounds-transport-ship-horn-1.opus">', '<speaker audio="alice-sounds-transport-ship-horn-2.opus">', '<speaker audio="alice-sounds-things-door-1.opus">', '<speaker audio="alice-sounds-things-door-2.opus">', '<speaker audio="alice-sounds-things-glass-2.opus">', '<speaker audio="alice-sounds-things-bell-1.opus">', '<speaker audio="alice-sounds-things-bell-2.opus">', '<speaker audio="alice-sounds-things-car-1.opus">', '<speaker audio="alice-sounds-things-car-2.opus">', '<speaker audio="alice-sounds-things-sword-2.opus">', '<speaker audio="alice-sounds-things-sword-1.opus">', '<speaker audio="alice-sounds-things-sword-3.opus">', '<speaker audio="alice-sounds-things-siren-1.opus">', '<speaker audio="alice-sounds-things-siren-2.opus">', '<speaker audio="alice-sounds-things-old-phone-1.opus">', '<speaker audio="alice-sounds-things-old-phone-2.opus">', '<speaker audio="alice-sounds-things-glass-1.opus">', '<speaker audio="alice-sounds-things-construction-2.opus">', '<speaker audio="alice-sounds-things-construction-1.opus">', '<speaker audio="alice-sounds-things-phone-1.opus">', '<speaker audio="alice-sounds-things-phone-2.opus">', '<speaker audio="alice-sounds-things-phone-3.opus">', '<speaker audio="alice-sounds-things-phone-4.opus">', '<speaker audio="alice-sounds-things-phone-5.opus">', '<speaker audio="alice-sounds-things-toilet-1.opus">', '<speaker audio="alice-sounds-things-cuckoo-clock-2.opus">', '<speaker audio="alice-sounds-things-cuckoo-clock-1.opus">']], ['key' => '#$animals_all$#', 'sounds' => ['<speaker audio="alice-sounds-animals-wolf-1.opus">', '<speaker audio="alice-sounds-animals-crow-1.opus">', '<speaker audio="alice-sounds-animals-crow-2.opus">', '<speaker audio="alice-sounds-animals-cow-1.opus">', '<speaker audio="alice-sounds-animals-cow-2.opus">', '<speaker audio="alice-sounds-animals-cow-3.opus">', '<speaker audio="alice-sounds-animals-cat-1.opus">', '<speaker audio="alice-sounds-animals-cat-2.opus">', '<speaker audio="alice-sounds-animals-cat-3.opus">', '<speaker audio="alice-sounds-animals-cat-4.opus">', '<speaker audio="alice-sounds-animals-cat-5.opus">', '<speaker audio="alice-sounds-animals-cuckoo-1.opus">', '<speaker audio="alice-sounds-animals-chicken-1.opus">', '<speaker audio="alice-sounds-animals-lion-1.opus">', '<speaker audio="alice-sounds-animals-lion-2.opus">', '<speaker audio="alice-sounds-animals-horse-1.opus">', '<speaker audio="alice-sounds-animals-horse-2.opus">', '<speaker audio="alice-sounds-animals-horse-galloping-1.opus">', '<speaker audio="alice-sounds-animals-horse-walking-1.opus">', '<speaker audio="alice-sounds-animals-frog-1.opus">', '<speaker audio="alice-sounds-animals-seagull-1.opus">', '<speaker audio="alice-sounds-animals-monkey-1.opus">', '<speaker audio="alice-sounds-animals-sheep-1.opus">', '<speaker audio="alice-sounds-animals-sheep-2.opus">', '<speaker audio="alice-sounds-animals-rooster-1.opus">', '<speaker audio="alice-sounds-animals-elephant-1.opus">', '<speaker audio="alice-sounds-animals-elephant-2.opus">', '<speaker audio="alice-sounds-animals-dog-1.opus">', '<speaker audio="alice-sounds-animals-dog-2.opus">', '<speaker audio="alice-sounds-animals-dog-3.opus">', '<speaker audio="alice-sounds-animals-dog-4.opus">', '<speaker audio="alice-sounds-animals-dog-5.opus">', '<speaker audio="alice-sounds-animals-owl-1.opus">', '<speaker audio="alice-sounds-animals-owl-2.opus">']], ['key' => '#$human_all$#', 'sounds' => ['<speaker audio="alice-sounds-human-cheer-1.opus">', '<speaker audio="alice-sounds-human-cheer-2.opus">', '<speaker audio="alice-sounds-human-kids-1.opus">', '<speaker audio="alice-sounds-human-walking-dead-1.opus">', '<speaker audio="alice-sounds-human-walking-dead-2.opus">', '<speaker audio="alice-sounds-human-walking-dead-3.opus">', '<speaker audio="alice-sounds-human-cough-1.opus">', '<speaker audio="alice-sounds-human-cough-2.opus">', '<speaker audio="alice-sounds-human-laugh-1.opus">', '<speaker audio="alice-sounds-human-laugh-2.opus">', '<speaker audio="alice-sounds-human-laugh-3.opus">', '<speaker audio="alice-sounds-human-laugh-4.opus">', '<speaker audio="alice-sounds-human-laugh-5.opus">', '<speaker audio="alice-sounds-human-crowd-1.opus">', '<speaker audio="alice-sounds-human-crowd-2.opus">', '<speaker audio="alice-sounds-human-crowd-3.opus">', '<speaker audio="alice-sounds-human-crowd-4.opus">', '<speaker audio="alice-sounds-human-crowd-5.opus">', '<speaker audio="alice-sounds-human-crowd-7.opus">', '<speaker audio="alice-sounds-human-crowd-6.opus">', '<speaker audio="alice-sounds-human-sneeze-1.opus">', '<speaker audio="alice-sounds-human-sneeze-2.opus">', '<speaker audio="alice-sounds-human-walking-room-1.opus">', '<speaker audio="alice-sounds-human-walking-snow-1.opus">']], ['key' => '#$music_all$#', 'sounds' => ['<speaker audio="alice-music-harp-1.opus">', '<speaker audio="alice-music-drums-1.opus">', '<speaker audio="alice-music-drums-2.opus">', '<speaker audio="alice-music-drums-3.opus">', '<speaker audio="alice-music-drum-loop-1.opus">', '<speaker audio="alice-music-drum-loop-2.opus">', '<speaker audio="alice-music-tambourine-80bpm-1.opus">', '<speaker audio="alice-music-tambourine-100bpm-1.opus">', '<speaker audio="alice-music-tambourine-120bpm-1.opus">', '<speaker audio="alice-music-bagpipes-1.opus">', '<speaker audio="alice-music-bagpipes-2.opus">', '<speaker audio="alice-music-guitar-c-1.opus">', '<speaker audio="alice-music-guitar-e-1.opus">', '<speaker audio="alice-music-guitar-g-1.opus">', '<speaker audio="alice-music-guitar-a-1.opus">', '<speaker audio="alice-music-gong-1.opus">', '<speaker audio="alice-music-gong-2.opus">', '<speaker audio="alice-music-horn-2.opus">', '<speaker audio="alice-music-violin-c-1.opus">', '<speaker audio="alice-music-violin-c-2.opus">', '<speaker audio="alice-music-violin-a-1.opus">', '<speaker audio="alice-music-violin-e-1.opus">', '<speaker audio="alice-music-violin-d-1.opus">', '<speaker audio="alice-music-violin-b-1.opus">', '<speaker audio="alice-music-violin-g-1.opus">', '<speaker audio="alice-music-violin-f-1.opus">', '<speaker audio="alice-music-horn-1.opus">', '<speaker audio="alice-music-piano-c-1.opus">', '<speaker audio="alice-music-piano-c-2.opus">', '<speaker audio="alice-music-piano-a-1.opus">', '<speaker audio="alice-music-piano-e-1.opus">', '<speaker audio="alice-music-piano-d-1.opus">', '<speaker audio="alice-music-piano-b-1.opus">', '<speaker audio="alice-music-piano-g-1.opus">']]]

Methods

getPause()

Получение разметки для вставки паузы между словами.

public static getPause( $milliseconds : int|float ) : string
Parameters
$milliseconds : int|float

Пауза в миллисекундах.

Tags
see

Смотри тут

api
Return values
string

getSounds()

Получение корректно составленного текста, в котором все ключи заменены на соответствующие звуки.

public getSounds( $sounds : array|null , $text : string ) : string

В случае Алисы, Маруси и Сбер это tts.

Parameters
$sounds : array|null

Пользовательские звуки.

$text : string

Исходный текст.

Tags
api
throws
Return values
string

replaceSound()

Замена ключей в тексте на соответствующие им звуки.

public replaceSound( $key : string , $value : string|array , $text : string ) : string
Parameters
$key : string

Ключ для поиска.

$value : string|array

Звук или массив звуков.

$text : string

Обрабатываемый текст.

Tags
api
Return values
string

removeSound()

Удаление любых звуков и эффектов из текста.

public static removeSound( $text : string ) : string
Parameters
$text : string

Обрабатываемый текст.

Tags
api
Return values
string

getSounds()

Получение звуков, которые необходимо воспроизвести или отправить.

public abstract getSounds( $sounds : array|null , $text : string ) : mixed

В случае Алисы, Маруси и Сбер это tts.

Parameters
$sounds : array|null

Массив звуков.

$text : string

Исходный текст.

Return values
mixed

Search results