function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
reettik mitrareettik mitra 

how to play an audio when the user enters text and clicks on a button

when the user enters text and clicks on a button and then that text is sent to text to speech api which returns base64 text then the text is decoded and audio is given as output in the component. I have managed to get the response from the api which is in form of string .Now I dont know how to decode andconvert it to audio. Any Suggestions??
ANUTEJANUTEJ (Salesforce Developers) 
Hi Reetik,

I see that there is an implementation of text to speech implementation in lightning components can you try checking it out once:

>> https://salesforcecodex.com/2019/08/add-text-to-speech-capability-in-lightning-component/

I hope this helps and in case if this comes in handy can you please choose this as the best answer so that it can be useful for others in the future.

Regards,
Anutej