

Note that the rate is an integer which corresponds to the number of words per minute and the volume a floating point between 0 and 1. Now, to change a property, we just call the setProperty module, which receives as input the name of the property and the value.
Volume = voiceEngine.getProperty('volume') We will also get the currently defined voice, although we will not change this property. So, we will get and print the values for the speech rate and volume and print then. You can check here the available properties. This method receives as input the name of the property and returns its value. To do so, we will call the getProperty method on the speech engine instance. Then, we will get the default values for both the speech rate and the volume. The first portion of the code is similar to the “Hello World” example and consists on importing the pyttsx module and getting an instance of the voice engine. So, we will check how to change these properties.

If you ran the mentioned “Hello World” program, which uses the default values for the speech rate and volume, you may have noticed that the speech is a little bit fast (although the volume is probably fine). If you need help installing the module, please check this previous “Hello World” tutorial. The objective of this post is to explain how to change the speech rate and volume on the pyttsx module.
