Discussions
Upload Audio Asset errors
I am trying to upload an audio recording from my phone. The android app records the audio in *.m4a format.
I call the API to upload the file:
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("audio/mpeg");
RequestBody body = RequestBody.create(mediaType, f"data:audio/mpeg;name=HellouokGarbage.mp3;base64,{raw_data}");
Request request = new Request.Builder()
.url("https://upload.heygen.com/v1/asset")
.post(body)
.addHeader("accept", "application/json")
.addHeader("Content-Type", "audio/mpeg")
.addHeader("X-API-KEY", "...")
.build();
Response response = client.newCall(request).execute();
I get the following error
{
"code": 400543,
"message": "Content type not match audio/mpeg != video/mp4"
}
I tried uploading the same file manually using the web interface, and it worked fine.