Convert the specified text to audio.

@param string $text The text to convert

@return string The audio data
511829
public function textToSpeech(string $text): string
    {
        if (strlen($text) > 100) {
            throw new InvalidArgumentException("Only messages under 100 characters are supported");
        }

        return $this->sendRequest("http://translate.google.com/translate_tts", [
            "q"         =>  $text,
            "tl"        =>  $this->language,
            "client"    =>  "duncan3dc-speaker",
        ]);
    }
1065188
public function convert($text)
    {
        $encoding = mb_detect_encoding($text);
        if (!$encoding || $encoding == 'ASCII' || $encoding == 'UTF-8') {
            return $text;
        }

        return mb_convert_encoding($text, 'UTF-8', $encoding);
    }
514587
public function speak(
        string $text,
        string $languageFrom,
        string $audioFormat = TtsAudioFormat::AUDIO_MP3,
        array $additionalData = []
    ): TtsResponse {
        $languageFrom = new Language($languageFrom);

        return $this
            ->getTtsApi($additionalData)
            ->textToSpeech($text, new Language($languageFrom), new TtsAudioFormat($audioFormat), $additionalData);
    }
846526
public function textToSpeech(string $text, FactoryInterface $factory = null): string
    {
        $filename = sys_get_temp_dir() . DIRECTORY_SEPARATOR . "speaker_picotts.wav";

        if (file_exists($filename)) {
            unlink($filename);
        }

        if ($factory === null) {
            $program = new Program($this->pico, new Silent());
        } else {
            $program = $factory->make($this->pico);
        }

        $result = $program->getResult("--wave={$filename}", "--lang={$this->language}", $text);

        if ($result->getStatus() !== 0) {
            throw new ProviderException($result->getFirstLine());
        }

        if (!file_exists($filename)) {
            throw new ProviderException("TextToSpeech unable to create file: {$filename}");
        }

        $result = file_get_contents($filename);
        if ($result === false) {
            throw new ProviderException("TextToSpeech unable to read file: {$filename}");
        }

        unlink($filename);

        return $result;
    }
393865
protected function renderText($text)
	{
		if ($this->enableNewlines) {
			return preg_replace("/(  \n|\n)/", "\\\\\\\\\n", $this->escapeLatex($text[1]));
		} else {
			return parent::renderText($text);
		}
	}
957508
private function _convertTagsToEscapeSequences ( $text ) {
        list($patterns, $replacements) = $this->_getConvertingDictionary();
        $convertedText = preg_replace($patterns, $replacements, $text);
        return $convertedText;
    }
957047
protected static function strlen($text) 
    {
        $exits = (function_exists('mb_strlen') && ((int) ini_get('mbstring.func_overload')) & 2);

        return $exits ? mb_strlen($text,'8bit') : strlen($text);
    }
709183
public function convertCharacters($text)
    {
        $text = html_entity_decode($text, ENT_QUOTES, $this->decode_charset);
        $text = strtr($text, $this->translation_table);

        return $text;
    }
905954
public static function decodeOctal($text)
    {
        $parts = preg_split('/(\\\\\d{3})/s', $text, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
        $text  = '';

        foreach ($parts as $part) {
            if (preg_match('/^\\\\\d{3}$/', $part)) {
                $text .= chr(octdec(trim($part, '\\')));
            } else {
                $text .= $part;
            }
        }

        return $text;
    }
487481
public function setPurpose($text)
    {
        return $this->client->apiCall('groups.setPurpose', [
            'channel' => $this->getId(),
            'purpose' => $text,
        ])->then(function () use ($text) {
            $this->data['purpose']['value'] = $text;
            return $text;
        });
    }
711619
static function parse($text)
    {
        $parser = new \Parsedown();

        $text = static::cleanLeadingSpace($text);

        return $parser->text($text);
    }
471569
public static function toAscii($text)
    {
        $encode = mb_detect_encoding($text, mb_detect_order(), true);
        return 'ASCII' === $encode ? $text : iconv($encode, 'ASCII//TRANSLIT//IGNORE', $text);
    }
804507
public function translate($text)
    {
        $translator = new Translation(new Client(), $this->config);

        return $translator->translate($text);
    }
668494
private function decode($text) {
		$pad = ord(substr($text, -1));
		if ($pad < 1 || $pad > 32) {
			$pad = 0;
		}

		return substr($text, 0, (strlen($text) - $pad));
	}
991351
public static function convertYAML($text) {
		
		try {
			$yaml = YAML::parse($text);
		} catch (ParseException $e) {
			printf("unable to parse documentation: %s..\n", $e->getMessage());
		}
		
		// single line of text won't throw a YAML error. returns as string
		if (gettype($yaml) == "string") {
			$yaml = array();
		}
		
		return $yaml;
		
	}
40295
public function setText(string $text)
    {
        $this
            ->getScanner()
            ->setText($text);
        $this->buffer = null;
        return $this;
    }
1131200
public function prompt($text) {

        // send out any escaping to implement anything sitting in the desired state
        $this->outputEscapeSequence();

        // save off the prompt string
        $prompt = $text  . $this->promptCaret . " ";

        // prompt and return the answer
        return $this->readUserInput($prompt);

    }