I have some audio files which are in amr
format, which I cant convert to any other format, Is there any way to play this files in IOS using swift(AVFoundation)
?
I tried this code
var audioPlaying = AVAudioPlayer()
audioPlaying = AVAudioPlayer(contentsOfURL: NSURL(fileURLWithPath:
NSBundle.mainBundle().pathForResource("music", ofType: "mp3")!), error: nil)
audioPlaying.play()
but when I use the "amr"
in ofType:
, getting an error which file not exist.
The first choice you have is converting the AMR audio files to an audio format that's supported by iOS, like MP3. If you don't want to change the format of the AMR file, you may install a video player that supports the AMR audio format so that you can use it to play your AMR files on iPhone.
You can open AMR files from your Google Drive and from your computer. It's very easy to use. You can control your playback like Play, Pause, Volume, Playlist and all common controls in any audio player. You don't need to install any further software or plugin to play AMR files.
AMR files can be opened by several media players, including Apple QuickTime Player, RealNetworks RealPlayer, and VLC Media Player.
Files in AMR format can be opened with Apple QuickTime Player, RealNetworks RealPlayer, MIKSOFT Mobile Media Converter and VideoLAN VLC media player in Mac Os , Microsoft Windows-based systems and Linux systems.
The Opencore-AMR iOS framework is probably your best starting point.
github.com/feuvan/opencore-amr-iOS
Also here's a guide on how to compile it for iOS as it's not an easy task :
http://swati-ios.blogspot.co.uk/2013/01/compile-opencore-amr-for-ios-projects.html
AMR
format is no longer supported by Apple (since iOS 4.3
).
If you want to Play or Record one, you have to use some tools (like opencore-amr
library) to change the format.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With