Skip to main content
Many languages are tonal (i.e. there is a specific way to pronounce them properly). In writing, this is indicated by certain marks which can help the reader (human or AI) to properly pronounce such text. The current endpoint supports Yoruba tone marking.

Request

The tone_mark() function can be used to add tone marks to a sentence. Pass the Yoruba language code and the text you want marked.

Best Practices for Use

When tone marking a sentence, use the language code yo; Yoruba is the only supported language at the moment.

Response

The response for tone marking is JSON.
  • The Content-Type is application/json
  • A request_id is returned for issue resolution with our support team.
Below is an example of a response from the API
{
  "request_id": "86095cea-77d5-45ba-a093-0f800ac2c7df",
  "text": "Báwo ni olólùfẹ́ mi?"
}

Language Support

Tone marking currently supports the following language:
  • Yoruba: yo

Examples

import os
from spitch import Spitch

os.environ["SPITCH_API_KEY"] = "YOUR_API_KEY"
client = Spitch()
response = client.text.tone_mark(
    language="yo",
    text="Bawo ni ololufe mi?"
)
print(response.text)   # Báwo ni olólùfẹ́ mi?
For error codes and retry guidance, see Troubleshooting.