ESP32-audioI2S icon indicating copy to clipboard operation
ESP32-audioI2S copied to clipboard

Pull request - speed parameter in Open AI https header is decimal / not String

Open kaloprojects opened this issue 6 months ago • 4 comments

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:

Image

this works: (impressive whispering human voice 😊 !)

Image

kaloprojects avatar May 31 '25 14:05 kaloprojects

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

kaloprojects avatar May 31 '25 14:05 kaloprojects

Then it will certainly work better now :-)

schreibfaul1 avatar May 31 '25 16:05 schreibfaul1

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

kaloprojects avatar May 31 '25 18:05 kaloprojects

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

schreibfaul1 avatar May 31 '25 19:05 schreibfaul1

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Jul 01 '25 03:07 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Jul 16 '25 03:07 github-actions[bot]