To add a new voice option to openai-fm, proceed as follows:
- Positioning Profiles: In the project directory, find the
data/voices.jsonfile, which is where all voice configurations are stored - Understanding the Configuration Structure: Each voice option is an object containing
id(unique identifier),label(display name) andvalue(corresponding to the parameter values of the OpenAI API) - Add new entry: Add a new voice configuration object to the json array in the format referenced in the existing entry
- Save changes: Ensure that files are saved in a valid JSON format
- restart sth.: The development server needs to be restarted (
npm run dev) to make the changes effective - test and verify: You should see the new option in the voice selection drop-down list in the web interface
Needs attention:
- added
valueMust be a valid speech identity supported in the OpenAI API - It is recommended to backup the original file before modification
- If there are other developers sharing the use of this project, the source of the added voice needs to be stated in the documentation
With this approach, developers can easily extend the voice options supported by the project to meet specific needs.
This answer comes from the articleOpenAI.fm: an interactive demo tool showcasing the OpenAI speech APIsThe































