MarusiaSound
extends TemplateSoundTypes
in
Класс отвечающий за воспроизведение звуков в Марусе.
Class MarusiaSound
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[] |
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
$standardSounds
Стандартные звуки.
protected
array[]
$standardSounds
= [['key' => '#$game_win$#', 'sounds' => ['<speaker audio="marusia-sounds/game-win-1">', '<speaker audio="marusia-sounds/game-win-2">', '<speaker audio="marusia-sounds/game-win-3">']], ['key' => '#$game_loss$#', 'sounds' => ['<speaker audio="marusia-sounds/game-loss-1">', '<speaker audio="marusia-sounds/game-loss-2">', '<speaker audio="marusia-sounds/game-loss-3">']], ['key' => '#$game_boot$#', 'sounds' => ['<speaker audio="marusia-sounds/game-boot-1">']], ['key' => '#$game_coin$#', 'sounds' => ['<speaker audio="marusia-sounds/game-8-bit-coin-1">', '<speaker audio="marusia-sounds/game-8-bit-coin-2">']], ['key' => '#$game_ping$#', 'sounds' => ['<speaker audio="marusia-sounds/game-ping-1">']], ['key' => '#$game_fly$#', 'sounds' => ['<speaker audio="marusia-sounds/game-8-bit-flyby-1">']], ['key' => '#$game_gun$#', 'sounds' => ['<speaker audio="marusia-sounds/game-8-bit-machine-gun-1">']], ['key' => '#$game_phone$#', 'sounds' => ['<speaker audio="marusia-sounds/game-8-bit-phone-1">']], ['key' => '#$game_powerup$#', 'sounds' => ['<speaker audio="marusia-sounds/game-powerup-1">', '<speaker audio="marusia-sounds/game-powerup-2">']], ['key' => '#$nature_wind$#', 'sounds' => ['<speaker audio="marusia-sounds/nature-wind-1">', '<speaker audio="marusia-sounds/nature-wind-2">']], ['key' => '#$nature_thunder$#', 'sounds' => ['<speaker audio="marusia-sounds/nature-thunder-1">', '<speaker audio="marusia-sounds/nature-thunder-2">']], ['key' => '#$nature_jungle$#', 'sounds' => ['<speaker audio="marusia-sounds/nature-jungle-1">', '<speaker audio="marusia-sounds/nature-jungle-2">']], ['key' => '#$nature_rain$#', 'sounds' => ['<speaker audio="marusia-sounds/nature-rain-1">', '<speaker audio="marusia-sounds/nature-rain-2">']], ['key' => '#$$#', 'sounds' => ['<speaker audio="marusia-sounds/nature-forest-1">', '<speaker audio="marusia-sounds/nature-forest-2">']], ['key' => '#$nature_sea$#', 'sounds' => ['<speaker audio="marusia-sounds/nature-sea-1">', '<speaker audio="marusia-sounds/nature-sea-2">']], ['key' => '#$nature_fire$#', 'sounds' => ['<speaker audio="marusia-sounds/nature-fire-1">', '<speaker audio="marusia-sounds/nature-fire-2">']], ['key' => '#$nature_stream$#', 'sounds' => ['<speaker audio="marusia-sounds/nature-stream-1">', '<speaker audio="marusia-sounds/nature-stream-2">']], ['key' => '#$thing_chainsaw$#', 'sounds' => ['<speaker audio="marusia-sounds/things-chainsaw-1">', '<speaker audio="marusia-sounds/things-explosion-1">', '<speaker audio="marusia-sounds/things-water-3">', '<speaker audio="marusia-sounds/things-water-1">', '<speaker audio="marusia-sounds/things-water-2">', '<speaker audio="marusia-sounds/things-switch-1">', '<speaker audio="marusia-sounds/things-switch-2">', '<speaker audio="marusia-sounds/things-gun-1">', '<speaker audio="marusia-sounds/transport-ship-horn-1">', '<speaker audio="marusia-sounds/transport-ship-horn-2">', '<speaker audio="marusia-sounds/things-door-1">', '<speaker audio="marusia-sounds/things-door-2">', '<speaker audio="marusia-sounds/things-glass-2">', '<speaker audio="marusia-sounds/things-bell-1">', '<speaker audio="marusia-sounds/things-bell-2">', '<speaker audio="marusia-sounds/things-car-1">', '<speaker audio="marusia-sounds/things-car-2">', '<speaker audio="marusia-sounds/things-sword-2">', '<speaker audio="marusia-sounds/things-sword-1">', '<speaker audio="marusia-sounds/things-sword-3">', '<speaker audio="marusia-sounds/things-siren-1">', '<speaker audio="marusia-sounds/things-siren-2">', '<speaker audio="marusia-sounds/things-old-phone-1">', '<speaker audio="marusia-sounds/things-old-phone-2">', '<speaker audio="marusia-sounds/things-glass-1">', '<speaker audio="marusia-sounds/things-construction-2">', '<speaker audio="marusia-sounds/things-construction-1">', '<speaker audio="marusia-sounds/things-phone-1">', '<speaker audio="marusia-sounds/things-phone-2">', '<speaker audio="marusia-sounds/things-phone-3">', '<speaker audio="marusia-sounds/things-phone-4">', '<speaker audio="marusia-sounds/things-phone-5">', '<speaker audio="marusia-sounds/things-toilet-1">', '<speaker audio="marusia-sounds/things-cuckoo-clock-2">', '<speaker audio="marusia-sounds/things-cuckoo-clock-1">']], ['key' => '#$animals_all$#', 'sounds' => ['<speaker audio="marusia-sounds/animals-wolf-1">', '<speaker audio="marusia-sounds/animals-crow-1">', '<speaker audio="marusia-sounds/animals-crow-2">', '<speaker audio="marusia-sounds/animals-cow-1">', '<speaker audio="marusia-sounds/animals-cow-2">', '<speaker audio="marusia-sounds/animals-cow-3">', '<speaker audio="marusia-sounds/animals-cat-1">', '<speaker audio="marusia-sounds/animals-cat-2">', '<speaker audio="marusia-sounds/animals-cat-3">', '<speaker audio="marusia-sounds/animals-cat-4">', '<speaker audio="marusia-sounds/animals-cat-5">', '<speaker audio="marusia-sounds/animals-cuckoo-1">', '<speaker audio="marusia-sounds/animals-chicken-1">', '<speaker audio="marusia-sounds/animals-lion-1">', '<speaker audio="marusia-sounds/animals-lion-2">', '<speaker audio="marusia-sounds/animals-horse-1">', '<speaker audio="marusia-sounds/animals-horse-2">', '<speaker audio="marusia-sounds/animals-horse-galloping-1">', '<speaker audio="marusia-sounds/animals-horse-walking-1">', '<speaker audio="marusia-sounds/animals-frog-1">', '<speaker audio="marusia-sounds/animals-seagull-1">', '<speaker audio="marusia-sounds/animals-monkey-1">', '<speaker audio="marusia-sounds/animals-sheep-1">', '<speaker audio="marusia-sounds/animals-sheep-2">', '<speaker audio="marusia-sounds/animals-rooster-1">', '<speaker audio="marusia-sounds/animals-elephant-1">', '<speaker audio="marusia-sounds/animals-elephant-2">', '<speaker audio="marusia-sounds/animals-dog-1">', '<speaker audio="marusia-sounds/animals-dog-2">', '<speaker audio="marusia-sounds/animals-dog-3">', '<speaker audio="marusia-sounds/animals-dog-4">', '<speaker audio="marusia-sounds/animals-dog-5">', '<speaker audio="marusia-sounds/animals-owl-1">', '<speaker audio="marusia-sounds/animals-owl-2">']], ['key' => '#$human_all$#', 'sounds' => ['<speaker audio="marusia-sounds/human-cheer-1">', '<speaker audio="marusia-sounds/human-cheer-2">', '<speaker audio="marusia-sounds/human-kids-1">', '<speaker audio="marusia-sounds/human-walking-dead-1">', '<speaker audio="marusia-sounds/human-walking-dead-2">', '<speaker audio="marusia-sounds/human-walking-dead-3">', '<speaker audio="marusia-sounds/human-cough-1">', '<speaker audio="marusia-sounds/human-cough-2">', '<speaker audio="marusia-sounds/human-laugh-1">', '<speaker audio="marusia-sounds/human-laugh-2">', '<speaker audio="marusia-sounds/human-laugh-3">', '<speaker audio="marusia-sounds/human-laugh-4">', '<speaker audio="marusia-sounds/human-laugh-5">', '<speaker audio="marusia-sounds/human-crowd-1">', '<speaker audio="marusia-sounds/human-crowd-2">', '<speaker audio="marusia-sounds/human-crowd-3">', '<speaker audio="marusia-sounds/human-crowd-4">', '<speaker audio="marusia-sounds/human-crowd-5">', '<speaker audio="marusia-sounds/human-crowd-7">', '<speaker audio="marusia-sounds/human-crowd-6">', '<speaker audio="marusia-sounds/human-sneeze-1">', '<speaker audio="marusia-sounds/human-sneeze-2">', '<speaker audio="marusia-sounds/human-walking-room-1">', '<speaker audio="marusia-sounds/human-walking-snow-1">']]]
Methods
getSounds()
Получение корректно составленного текста, в котором все ключи заменены на соответствующие звуки.
public
getSounds(
$sounds :
array|null
, $text :
string
)
: string
В случае Алисы, Маруси и Сбер это tts.
Parameters
- $sounds : array|null
Пользовательские звуки.
- $text : string
Исходный текст.
Tags
Return values
stringreplaceSound()
Замена ключей в тексте на соответствующие им звуки.
public
replaceSound(
$key :
string
, $value :
string|array
, $text :
string
)
: string
Parameters
- $key : string
Ключ для поиска.
- $value : string|array
Звук или массив звуков.
- $text : string
Обрабатываемый текст.
Tags
Return values
stringremoveSound()
Удаление любых звуков и эффектов из текста.
public
static removeSound(
$text :
string
)
: string
Parameters
- $text : string
Обрабатываемый текст.
Tags
Return values
stringgetSounds()
Получение звуков, которые необходимо воспроизвести или отправить.
public
abstract getSounds(
$sounds :
array|null
, $text :
string
)
: mixed
В случае Алисы, Маруси и Сбер это tts.
Parameters
- $sounds : array|null
Массив звуков.
- $text : string
Исходный текст.