You need to set some permission to the service account, import libraries and install libraries. You can see this documentation[1] with some examples.Also you can add more information about the error.
[1]https://cloud.google.com/text-to-speech/docs/ssml-tutorial#windows