dimitris-c / AudioStreaming

An AudioPlayer/Streaming library for iOS written in Swift using AVAudioEngine.
MIT License
266 stars 56 forks source link

Can't play audio #25

Closed Keerthi-Sparkout closed 3 years ago

Keerthi-Sparkout commented 3 years ago

I got this error while playing an audio. This audio recorded from samsung mobile. "Couldn't parse the bytes from the stream. Status: The file is malformed, not a valid instance of an audio file of its type, or not recognized as an audio file."

Note: But this same audio is playing well in avplayer and safari browser also.

dimitris-c commented 3 years ago

This is probably due to an invalid file — error code kAudioFileStreamError_InvalidFile This library is using Audio File Stream Services — https://developer.apple.com/documentation/audiotoolbox/audio_file_stream_services?changes=__11&language=swift

I'm not 100% how AVAudio solves this, if you can share the audio file I can investigate if I have some time

dimitris-c commented 3 years ago

Closing this, due to lack of response.

iosdevpriyank commented 2 years ago

Same issue with this library: Song URL: https://chatsta.s3.ap-south-1.amazonaws.com/test/audio/1653555504995-1651101577581-Lets.mp3 I tried but the audio not playing.

dimitris-c commented 2 years ago

@PriyankGandhi30 I can't access the URL, make sure you're using the correct authentication, you can pass headers if required

iosdevpriyank commented 2 years ago

@dimitris-c This is a new link: https://chatsta.s3.ap-south-1.amazonaws.com/test/audio/1651101577581-Let-s-Get-it-on---trimmed.mp3

dimitris-c commented 2 years ago

The error is "The file is malformed, not a valid instance of an audio file of its type, or not recognized as an audio file." aka kAudioFileStreamError_InvalidFile try verifying that you have a correctly encoded mp3 file.