When using a recent Kokoro-FastAPI as the backend, the extension is unable to read the list of voice from the API call to /audio/voices.
It expects a string list of voices, but the API returns a object with id and name (e.g. {"voices":[{"id":"af_alloy","name":"af_alloy"},{"id":"af_aoede","name":"af_aoede"}]}
fetchVoices moz-extension://5f7445c0-96fc-48a9-aec0-099ddda39d7b/popup.js:80
fetchVoices moz-extension://5f7445c0-96fc-48a9-aec0-099ddda39d7b/popup.js:80
fetchVoices moz-extension://5f7445c0-96fc-48a9-aec0-099ddda39d7b/popup.js:80
restoreOptions moz-extension://5f7445c0-96fc-48a9-aec0-099ddda39d7b/popup.js:436
async* moz-extension://5f7445c0-96fc-48a9-aec0-099ddda39d7b/popup.js:521
EventListener.handleEvent* moz-extension://5f7445c0-96fc-48a9-aec0-099ddda39d7b/popup.js:520
popup.js:82:17
The backend states that you can use the query option ?legacy=true to get the old format.
https://github.com/remsky/Kokoro-FastAPI/blob/3f64dc26081dcb79e4d04ecb3d88da263be76964/api/src/routers/openai_compatible.py#L549
Another option could be a try block to test the new, then the old format to catch both cases.
|
return data.voices.filter(v => validPrefixes.some(prefix => v.startsWith(prefix))); |
I can confirm that spawning Kokoro-FastAPI with the bool flipped (async def list_voices(legacy: bool = True):) resolves the extension issue.
When using a recent Kokoro-FastAPI as the backend, the extension is unable to read the list of voice from the API call to
/audio/voices.It expects a string list of voices, but the API returns a object with
idandname(e.g.{"voices":[{"id":"af_alloy","name":"af_alloy"},{"id":"af_aoede","name":"af_aoede"}]}The backend states that you can use the query option
?legacy=trueto get the old format.https://github.com/remsky/Kokoro-FastAPI/blob/3f64dc26081dcb79e4d04ecb3d88da263be76964/api/src/routers/openai_compatible.py#L549
Another option could be a try block to test the new, then the old format to catch both cases.
kokoro-extension/popup.js
Line 80 in 1aac53a
I can confirm that spawning Kokoro-FastAPI with the bool flipped (
async def list_voices(legacy: bool = True):) resolves the extension issue.