ZHChat icon indicating copy to clipboard operation
ZHChat copied to clipboard

Audio is not playing?

Open GopiK14 opened this issue 6 years ago • 5 comments

Hi Team,

We need to play audio file received from andriod, we get in 2 formats .mp3 or .aac. Both the audio format not playing in iOS with 'ZHCAudioMediaItem'. We tried to convert the same to 'm4a' and tried but no luck.

#1 - Confirm receive audio has data - we renamed local file extension to m4a - it working fine - just confirm audio is not a problem.

#2 - Please check screenshot - its print audiodata bytes so audiodata is not nil.

screen shot 2018-05-15 at 1 51 02 am

Any solution, Please suggest some other solutions.

GopiK14 avatar May 14 '18 20:05 GopiK14

convert data to m4a not fileName.aac. If u don't know what's wrong with ur code. u should check audio guide. aac is sort format not fileName.

deankai avatar May 15 '18 02:05 deankai

Thanks! I renamed the received file to .m4a once downloaded but it not playing. If possible, can you share a audio conversion code would be really helpful.

GopiK14 avatar May 15 '18 04:05 GopiK14

Any solution for this?

GopiK14 avatar May 16 '18 09:05 GopiK14

did u play audio from file , not data? When u get data ,then save it to file ,then get data from file. Make sure that u get right file name. And it can really be played , like demo.

deankai avatar May 16 '18 09:05 deankai

Yes, I write the data to local file with .m4a format but not player. Is it support mp3 format right or we need to consider other formats?

GopiK14 avatar May 16 '18 09:05 GopiK14