Help with Scrips and TTS

I’ve tried a few changes and playing around with the code and go no where. If you have any more luck please post back on what you did would be greatly appreciated. also what tpye of speakers are you trying to play the tts through?

think this might help actually just saw this post and its has adding homeassistant user to audio group
by sudo usermod -a -G audio homeassistant
not sure how I meant to do this is it just run that code in my putty or log in to the virtual area of home assistant. so any assistant would be helpful