Hello dear Bubblers,
I’m writing this at midnight after spending an entire day rebuilding a lot of my app logic.
In summary, I am building an AI assistant (just like Siri!) and so far so good, but one problem I am facing is my Text to Speech workflow is just running completely out of order and ruining everything.
Basically, I have a speaker button that when clicked runs an OpenAI TTS call, set a state of my bot main group to that audio file, saves the audio file, and then runs that audio file (I used to do it with autoplay in an html but discovered that it breaks in IOS since it blocks autoplay, so I figured a way to use an action to save that file and then run it in an action instead of an autoplay).
Things to know first:
-
Everything else is working fine, I pinpointed down to the TTS workflow.
-
I am using the AudioPlayer plugin to run the files received from OpenAI, the reason I am not using a normal HTML to autoplay this is that IOS blocks autoplay, and this plugin is the only way I found where I can manually play a file inside a workflow without autoplay or user interacting with it (per IOS rules).
I don’t think I’m facing any issues with the plugin.
(if you know a workaround for the autoplay for real-time dynamic files for IOS let me know!). -
IMPORTANT: the workflow runs flawlessly in the Slow and Step by Step modes, but in normal mode, it completely flops. I searched this forum and found similar incomplete posts mentioning that it’s because setting states inside a workflow can get out of order and workflows get out of order as well.
-
Although I eventually want to have my bot respond automatically I think I would get that part working if I can get this issue fixed first --having an out-of-order workflow with states and API calls.
(and I don’t want to make the post too long)
This is the button clicked for the bot to read the message:
This is the button workflow (the states here are just used to display a loading screen on my bot so don’t worry about it):
This is the workflow for my custom event I included on the previous button workflow to retrieve OpenAI TTS data, set the state of my bot tab to that audio file, set up my audio track plugin to that file, and then play the file.
(the reason I have Set Track Audio is because if I have my audio element receive the audio file from the custom state directly on the homepage without an action then I have to set it up as an autoplay which means it won’t work for IOS as I mentioned):
This’s my set state action:
And here is my audio element on my homepage (nothing to see here really)
This’s simillar to having an HTML that auto plays your audio file from your custom state set on the bot, but then it won’t work on IOS which is why I prefer to manually call and play the audio as I did.
And here is a video demonstrating how my workflow runs well in step by step/slow and when it doesn’t in case it was long to read
If you can provide me with any help that would mean the world to me because I really struggled today rebuilding all the workflows and stuff