Score a Phoneme list
In this example we score the term:
gotcha
/g/ao1/ch/ah0
Since gotcha is an american vernacular and not a valid dictionary word we use the phoneme list API to score it.
The phoneme list uses a different url endpoint and expects the list of phonemes in Arpabet notation.
Note that we specify phoneme stress as 0,1,2 per Arpabet notation. This API allows you to score any word or sentence that can phonetically expressed in Arpabet.
Copy the example code and be sure to:
- Add your Speechace API key
- Add a valid file path in the useraudiofile parameter. For example in curl the you would add something like @/tmp/gotcha_16k.wav
You can download a sample gotcha_16k.wav file here.
Request Params
| Key | Datatype | Required | Description |
|---|---|---|---|
key | string | API key issued by Speechace. | |
user_id | string | A unique anonymized identifier for the end-user who spoke the audio. |
Structure this field to include as much info as possible to aid in reporting and analytics.
For example: user_id=XYZ-ABC-99001 where:
- XYZ is an id for your Product or App
- ABC is an id for the customer/site/account
- 99001 is an id for the end-user
Ensure user_id is unique and anonymized containing no personally identifiable information. |
| dialect | string | | The dialect to use for scoring. Supported values are "en-us" (US English) and "en-gb" (UK English).
en-gb requires setting v0.1 in url path. i.e. https://api.speechace.co/api/scoring/text/v0.1/json? |
Request Body
[{"name"=>"phone_list", "value"=>"g|ao|ch|ah", "datatype"=>"string"}, {"name"=>"user_audio_file", "value"=>nil, "datatype"=>"null"}, {"name"=>"question_info", "value"=>"'u1/q1'", "datatype"=>"string"}]
RESPONSES
status: OK
{"status":"success","quota_remaining":-1,"word_score":{"word":"g|ao|ch|ah","quality_score":97,"phone_score_list":[{"phone":"g","stress_level":null,"extent":[46,60],"quality_score":99.14285714285714,"sound_most_like":"g"},{"phone":"ao","stress_level":null,"extent":[60,67],"quality_score":96.42857142857143,"sound_most_like":"ao"},{"phone":"ch","stress_level":null,"extent":[67,83],"quality_score":97.125,"sound_most_like":"ch"},{"phone":"ah","stress_level":null,"extent":[83,105],"quality_score":96.63636363636364,"sound_most_like":"ah"}]},"version":"0.5"}