how to play Google speech to text api buffered audio in AVAudioPlayer swift

145 Views Asked by At

I am using google speech to text app, for converting speech into text. speech is buffered in AudioBufferList and further converted into Data. when I am trying to play same Data in AvudioPlayer using its init method "AVAudioPlayer(contentOf: Data)" it not playing. gives me error "OSStatus 1954115647" which is unsupported file type.

I have tried playing an .WAV file after converting .WAV file into Data, it works fine.

I expect to play the buffered audio in AVAudioPlayer.

0

There are 0 best solutions below