Speechace
  • Introduction
    • Overview
    • Use-Cases
  • Getting Started
    • Pre-requisites
      • API Features
      • Getting the API Key
      • API Regions and endpoints
      • API Limits
    • API Samples
    • Supported Languages
    • API Versioning
    • Authentication
    • Try the Speechace API
    • Error Handling
      • Common Errors
      • Retry Strategies
  • Solutions
    • Speaking Practice for Language Learning
    • Automated Language Assessment with AI
    • Voice AI for Early Literacy
    • Test Prep for Standardized tests
      • PTE Speaking Questions
      • IELTS Speaking Questions
      • TOEFL Speaking Questions
      • CEFR Speaking Questions
      • TOEIC Speaking Questions
    • Speaking Practice in Spanish and French
  • Features
    • Introduction
    • Scripted activities
      • Pronunciation Scoring
        • Word and Sentence pronunciation
        • Multiple choice
        • Custom pronunciations
        • Phoneme list
      • Fluency scoring
        • Passage scoring
      • Lexical stress and intonation
    • Spontaneous activities
      • Open-ended scoring
        • Language scoring
        • Relevance scoring
        • Language detection
      • Task achievement scoring
        • Describe Image
        • Re-tell Lecture
        • Answer Question
  • API Reference
    • Postman API reference
    • Score Text/Pronunciation
      • Handling overall scores
      • Handling word scores
      • Handling phoneme and syllable scores
    • Score Text/Multiple choice
      • Handling multiple choice response
    • Score Text/Markup Language
      • Handling Markup Response
    • Score Text/Stress & Intonation
      • Handing stress and intonation response
    • Score Text/Phoneme list
      • Handling phoneme list response
    • Score Text/Fluency
      • Handling fluency response
      • Fidelity detection
    • Score Text/Validate Text
    • Score Speech/Open-ended
      • Handling language scores
      • Per metric feedback
        • Grammar metrics
        • Vocabulary metrics
        • Coherence metrics
    • Score Speech/Relevance
      • Handling relevance response
    • Score Speech/Language Detection
    • Score Task/Task Achievement
  • Guides on common topics
    • Intepreting quality score
    • Interpreting overall scores
      • Pronunciation Bands
      • Fluency Bands
      • Vocabulary Bands
      • Grammar Bands
      • Coherence Bands
    • Scoring rubrics
    • Interpreting fidelity class
    • Phonetic notation
      • US English (en-us)
      • UK English (en-gb)
      • French (fr-fr, fr-ca)
      • Spanish (es-es, es-mx)
    • Getting word timestamps in audio
    • Automatic handling of unknown words
    • Phoneme to letter mapping
    • Markup Language
  • Other Resources
    • Requesting Support
    • Rate Limiting
    • Data Retention
    • FAQs
    • Appendices
Powered by GitBook
On this page
  • Request Format
  • Response Example
  1. API Reference

Score Speech/Language Detection

PreviousHandling relevance responseNextScore Task/Task Achievement

Last updated 6 months ago

Run in Postman:

Request Format

The request parameters in the cURL code below are the same as in the scoring function. To detect the language following parameters can be used:

  1. detect_dialect = 1: This parameter is used to detect the dialect of the spoken language without impacting the user's test score. This approach is more lenient, allowing the user to proceed with their score intact even if the detected dialect doesn’t match the expected one. In this case, the API output will return the potential language in which the user provided a response.

  2. enforce_dialect = 1: This parameter is used to enforce the correct dialect, resulting in a hard error if the response is in an unexpected language. If the detected dialect is incorrect, the API will generate an error, and the developer can set the user's score to zero based on this error response.

curl --location -g 'https://api.speechace.co/api/scoring/speech/v9/json?key={{speechace_premiumkey}}&dialect=en-us' \
--form 'user_audio_file=@"kevin.m4a"' \
--form 'detect_dialect = 1'
curl --location -g 'https://api.speechace.co/api/scoring/speech/v9/json?key={{speechace_premiumkey}}&dialect=en-us' \
--form 'user_audio_file=@"kevin.m4a"' \
--form 'enforce_dialect = 1'

Response Example

The following responses illustrate two scenarios: in the first case, the language code for the detected language/dialect is reported under the key detected_dialect, resulting in a warning for the user. In the second case, an incorrect dialect triggers an enforced error under the key detail_message, preventing further action.

{
    "status": "success",
    "quota_remaining": -1,
    "speech_score": {
        "transcript": "Ich liebe den Winterurlaub, weil ich die kalte Luft und den Schnee genieße.",
        "word_score_list": [....],
        "ielts_score": {...},
        "pte_score": {...},
        "speechace_score": {...},
        "toeic_score": {...},
        "cefr_score": {...},
        "fluency": {...},
        "detected_dialect": {
            "lang_id": "ge"
        },
        "asr_version": "0.4"
    },
    "saved_file_path": ".../d3b09f662d0eadd8d91266ecfe1b211f.mp3",
    "version": "9.9"
}
{
    "status": "error",
    "short_message": "non_dialect_language_detected",
    "detail_message": "The audio file contains speech in 'ge' language different from dialect 'en-us'.",
    "saved_file_path": ".../1be7e652583cf51553595a16cdd6a1d3.mp3",
    "version": "9.9"
}

Language Scores
Score Text/Open-ended