ESP32-audioI2S
ESP32-audioI2S copied to clipboard
Pull request - speed parameter in Open AI https header is decimal / not String
Hi @schreibfaul1 , also adding @akdeb as he made some changes (added voice instructions)
there is a tiny bug in Audio.h line 435. OpenAI parameter 'speed' is type decimal in https header, not String (so both " should be removed):
Change Request in line 435 from "\"speed\": \"" + speed + "\"" +
to "\"speed\": " + speed +
without this change (current sitution) : the new feature 'voice instruction' does not work (audio_play.openai_speech(..) is silent), with this update line: the_audio_play.openai_speech(..) is working perfectly with & without Voice instruction 👍
thank you both 😊 .. wish you a great Sunday further :)
__
Background (in case of interest): When i started to test the new voice instruction parameter (with my PSRAM ESP32), then I've seen that OpenAI no longer speaking when adding voice instruction String with required new model 'gpt-4o-mini-tts' (new model needed for voice instruction).
So i checked Postman .. found root cause, the new model gpt-4o-mini-tts expects a decimal parameter 'speed' not a String. Btw: this is same as on older tts-1 (was always a decimal, but newer model seem less tolerant), Funny detail: Speed is not even supported in new model, still decimal expected)
See Postman tests here:
this fails:
this works: (impressive whispering human voice 😊 !)
Btw: The new 4th parameter (voice instruction) in openai_seech() is worth to test !
Example (same as in Postman above):
.. audio.openai_speech( APIKEY, "gpt-4o-mini-tts", "Hallo, wie geht es dir heute?", "you are whispering", "onyx", "aac", "1");
here the result (zip contents a mp3 audio) : Server response - Whispering voice.zip
Then it will certainly work better now :-)
Then it will certainly work better now :-)
but i was too late few hours, right ? it did not become part of major release 3.3.0 (LOL) .. but at least in latest 3.3.0a 😆 👍
btw: it works fine now, just tested with your latest zip
Yes, retroactively changing something in the history is not easy. You could test VSCode, then you can always update to the master and have full version control. I have a template, so it's easy to install: https://github.com/schreibfaul1/ESP32_Arduino_ESPIDF
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.