diff --git a/plugins/read/config_default.py b/plugins/read/config_default.py index c55a1555640925733fbf60483cf6cd820ec202e2..1103345c9da6732093b2830978f6e13b371968bc 100644 --- a/plugins/read/config_default.py +++ b/plugins/read/config_default.py @@ -4,3 +4,9 @@ MAX_STRING_LENGTH = 300 APP_ID = "" API_KEY = "" SECRET_KEY = "" + +# Volume 1(low)-10(high) +VOLUME = 8 +# Speech rate 1(slow)-10(quick) +SPEED = 4 + diff --git a/plugins/read/read.py b/plugins/read/read.py index 3099d2fee3b2ad6dfff9ba17b6a83f86bc4d44ed..5355e53d759412b44158ce35bee6784a4ad83e28 100644 --- a/plugins/read/read.py +++ b/plugins/read/read.py @@ -30,9 +30,9 @@ def read(bot, context, args): def handle(): client = AipSpeech(config.APP_ID, config.API_KEY, config.SECRET_KEY) voice = client.synthesis(string, 'zh', 1, { - 'vol': 10, + 'vol': config.VOLUME, 'per': 4, - 'spd': 4 + 'spd': config.SPEED }) tmpdir = tempfile.mkdtemp()