I need to send text to server, get wav streaming data (Base64 form and locally converting to byteArray), save and play the files. As retrofit cannot process larger than around 5 million characters I am splitting the text into pieces and getting the several wav streaming data. Now my target is to save the fetched multiple wav data into one file and play further.
But the problem is when I am concatenating the stream data(byteArray), the files playing the first one only. I googled and searched in SO for solutions but it is not working at all. what could be the reason(could be for header issue and I tried skipping first 44 length from 2nd one).
this is how tried
if (count == 0)
allByteArray += clipData
else
allByteArray += clipData.copyOfRange(44,clipData.size)
count += 1
return until all arrayByte
val output = FileOutputStream(file,true)
output.write(allByteArray)
output.close()