locked
Invalid Audio Format: Not a WAVE file - no RIFF header RRS feed

  • Question

  • I'm trying to use Speaker Recognition API Identification Profile - Create Enrollment from client side javascript.

    I created wav file from microphone user input using JS code from https://www.microsoft.com/cognitive-services/en-us/speaker-recognition-api example. But when i sending it by ajax call to https://api.projectoxford.ai/spid/v1.0/identificationProfiles/{identificationProfileId}/enroll[?shortAudio] it always returning 

    {
      "error": {
        "code": "BadRequest",
        "message": "Invalid Audio Format: Not a WAVE file - no RIFF header"
      }
    }
    Sample code:
        var formdata = new FormData();
        formdata.append('data', Blob.Data);
        $.ajax({
          url: 'https://api.projectoxford.ai/spid/v1.0//identificationProfiles/' + identificationProfileId + '/enroll?shortAudio=true',
          beforeSend: function(xhrObj){
            // Request headers
            xhrObj.setRequestHeader("Content-Type", "application/octet-stream");
            xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key", apiKey);
          },
          type: "POST",
          processData: false,
          // contentType: false,
          // mimeType: 'multipart/form-data',
          // cache: false,
          // contentType: false,
          // processData: false,
          // dataType: "json",
          data: formdata
        })
        .done(function(data) {
           alert("success");
        })
        .fail(function() {
           alert("error");
        });
    
    What i'm doing wrong?


    Friday, November 4, 2016 2:45 PM

All replies

  • Thanks for your interest in the Speaker Recognition API.

    We started investigating this case, and we will get back to you very soon.

    Thanks for your patience.

    Wednesday, November 9, 2016 12:37 PM