I think you misunderstood what the OP is after
They'd like to to be able to access a sound sample of the text to speech block not just hear the sound
A reporter (round block) reports a value that another block can use as an input
Could you show me the code so I can test it?
I just use someone's contrib node in NodeRED
This is the node I use with the TTS Service using Google (without credentials) setting
I've no idea how it works but maybe if you explore the source code for it you could work it out
 I've glanced thru its code and I "think" that its using a Google translation API to do the conversion - but I can't work out the details so far
There's a lot of noise when you try and search for free text to speech API
[edit2] Made some progress
provide a free service but it does require signing up and getting a key
Which is fine for personal projects but not good for public ones
I've got as far as this with it
I think I just need to work out how to make Snap! play the returned data as a sound
Well, one issue is that the url block returns at UTF-16 (I think) encoded string and that is no good for binary data such as an audio wav file
But I cannot get it to playback properly in Snap!
I'm obviously missing something somewhere
maybe code in something like SAM (software automatic mouth)
You may try "b64" options...
Ouptut seems to be a RIFF, but
probably require only the data (samples) part of the RIFF.
Victory is mine
(Just need to add your Voice RSS key as mentioned in previous post)
Then it turns out the audio data is from item 47 to the end of the file (should work for any reasonable TTS request)
(I've got a more complicated version that will handle 16bits if needed)
or with custom reporters
And then we can convert the samples into a Snap! sound