cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
982
Views
0
Helpful
0
Replies

Upload for a Greeting Wav file with CUPI API, The Audio is getting Corrupted/Unplayable

Hi,

I used the below greetings API which is for 8.5 and later to upload/update greeting audio file to unity in 11.5 environment.

http://<connection-server>/vmrest/handlers/callhandlers/<call handler object id>/greetings

/<greeting type>/greetingstreamfiles/<language id>/audio content is audio/wav data

The audio file i tried to upload is in mono, u-law 64 bit. When i upload this audio file directly in the Unity Portal without using any APIs, the audio file was playing correctly when i call the DID number.


When i upload the audio with the API, the Audio file is getting uploaded with Status code 204. However, the file is getting Corrupted/Unplayable when i try to play the file.

When i open the audio file in Gold wav, it gives me an error message "internal data size is incorrect, the data may be corrupt", but the attributes for that audio are still u-law, mono. I also tried to send the audio file 1024 bytes but i started getting status code 400 - unsupported media type.


BufferedInputStream buf = new BufferedInputStream(input);

int readBytes = 0;

byte[] bytes= new byte[1024];

// read from the file; write to the ServletOutputStream

while ((readBytes = buf.read(bytes)) != -1) {

// System.out.println("Message Flushed "+readBytes);

out.write(readBytes);

}

out.flush();

buf.close();

I also tried with various other audio formats like mono, u-law 8 bit 8.0 KHz, mono, u-law 16 bit 8.0 KHz. When i try to upload them, i get an error - Unsupported media type.

The upload till Temp directory is working fine. When i play audio file from my temp directory, the Audio is getting played. I also checked the Attributes, it shows ulaw-mono. Not sure where is the problem.


Kindly help me with this issue.

0 Replies 0