thuanvp012van/gtts
最新稳定版本:v1.2.0
Composer 安装命令:
composer require thuanvp012van/gtts
包简介
Google Text-to-Speech for php
README 文档
README
Install
composer require thuanvp012van/gtts
Usage
-
Use with php
use Thuanvp012van\GTTS\GTTS; use Thuanvp012van\GTTS\Language; require './vendor/autoload.php'; $gtts = new GTTS('Xin chào mọi người', Language::VI); // or $gtts = (new GTTS('Xin chào mọi người'))->autoDetection(true); $gtts->save('helloworld.mp3');
-
Use with command-line
php ./vendor/bin/gtts languages # Show all languagesphp ./vendor/bin/gtts save --file=helloworld.mp3 --language=vi 'Xin chào mọi người' # Convert text to speech.
OR
php ./vendor/bin/gtts save --file=helloworld.mp3 --auto-detection 'Xin chào mọi người' # Automatic language detection.
Methods
text(string $text): Set text.getText(): Get text.lang(\Thuanvp012van\GTTS\Language $lang): Set language.getLang(): Get language.autoDetection(bool $autoDetection): Set auto detection.isAutoDetection(): Check is auto detection.topLevelDomain(string $tld): Set top level domain.getLevelDomain(): Get top level domain.slowSpeed(): Set slow reading speed.normalSpeed(): Set normal reading speed.isSlowSpeed(): Check is slow reading speed.isNormalSpeed(): Check is normal reading speed.save(string $fileName): Save speech as file.stream(): Get parts of speech.
统计信息
- 总下载量: 35
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2023-04-24