How to play AMR audio file on iPhone - iphone

I have tried using AVAudioPlayer , MPMoviePlayer to play AMR files but unable to play them. AVAudioPlayer play method always returns NO for AMR files and MPMoveiPlayer post MPMoviePlayerPlaybackDidFinishNotification as soon as it is played. Even tried to play play AMR with webview but without success.
Is there any other way to play AMR files. According to this post About AMR audio file playing issue on different devices iOS4.3 above does not support AMR ,but how can mail app can play AMR files?
I tried converting AMR to caf file using ExtAudioFile ,but I am getting an error code 1718449215 which I found out that it means kAudioFormatUnsupportedDataFormatError.

Even it is an old question, I still do not have an answer.
Instead, my way is converting to wave in advance, with the use of the following library from Github
https://github.com/justinjing/RecordWAVToAMRDemo/blob/master/AmrConvertAndRecord/VoiceConvert/VoiceConverter.mm

Related

Play sound in the WebView provided by vscode

I want to develop a plug-in to play local sound.So I make a demo for test with audio
:
<audio src="vscode-resource:/Users/asure/Documents/Projects/test/EffectMove.mp3" controls>
/Users/asure/Documents/Projects/test it's the directory where I tested it.I also tested after adding it to localResourceRoots.Below was what I get.
It seems that sound didn't load correctly while no errors can be found in console window.I was confused whether vscode disable audio related content in webview or something was wrong in my code.
Does anyone know how to play sound in the webview provided by vsocde
VSCode does not support playing sound with audio tag in WebView.
you can use web audio API instead.
and there is already an extension that plays local sound files with web audio API.
Because vscode does not support audio playback.
Actually, I just learned that we strip out ffmpeg and other media support from our release builds. This is by-design and something we will not change, but it does mean that many types of media playback will never be supported in webviews inside vscode
source: https://github.com/microsoft/vscode/issues/32540
Vscode v1.71 will support various audio codecs within a webView.
See release notes: ffmpeg support.
It includes mp3 suuport and
Vorbis
Flac
H.264
VP8
WAV
MP3
Ogg

iPhone - IMA WAV ADPCM audio stream for iOS

I am trying to write an app for a school project that will play a video stream of the lab. They use Foscam cameras, and from what I understand they only stream audio in FFMPEG and VLC (a wrapper of FFMPEG and others, correct?). I can play the video stream in a UIWebView just fine, but I can't figure out how to get audio to work. I have read a bunch of post on here about the different audio stream options, but none support this format. I have also looked into VLCKit, but that seems to only work in OS X, not iOS.
Is there a Framework, or Kit that can stream IMA WAV ADPCM audio from a VLC/FFMPEG file, or does someone know of a better way to get audio from a Foscam?
EDIT - I know more about the stream and I have tried a few things. I tried AVPlayer, but discovered Audio FIle Stream and Audio Queue Services but can't find a good tutorial.
I also found THIS site, and tried the project with my stream and it did not work.

playing downloaded audio video in iphone

Hi seen many tutorial but couldn't find the right workable answer. I need to play audio and video file from my webservice, for this I want to download the file and play it in the app, seen tutorial for avPlayer nothing workable. Please provide link or guide how to do this.
Use MPMoviePlayer, as this can open network streams and despite the name works with audio. The only thing is this pops up the modal player with controls.
First Download the network file using NSURLConnection and store it locally, then use AVAudioPlayer to play the local file.

Playing Audiobooks (m4b media format) using AudioQueue services | iPhone

I am working on developing an iPhone app to play music. Am using AudioQueue services to play the audio files. App plays all media files correctly, but the app fails to play audiobooks, which I think is because they are different media format (.m4b) from other media items in my library (mp3).
I am sure I need to change how am initializing the audioqueue or AVAssetReaderTrackOutput to play media with different file format but am not sure how.
Can anyone point me to right direction.
Thanks in advance
I have figured it out, the issue was not because of the media format. The Audiobook I was trying to play in my app was DRM protected, so the was unable to play it.
Thanks

iPhone: streaming WMA, MP3 and AAC

I need to create a simple media player that can stream internet radio stations in WMA, MP3 and AAC formats as part of a bigger app.
I was wondering if someone could please give me some pointers on where to start and how to go about tackling each of these formats? never really handled this topic before..
Thanks!
For audio streaming on the iPhone you'll have to use the AudioQueue framework. This framework has native support for mp3 and aac but is not easy to get started with. There's an open source project by Matt Gallagher that can play mp3 and aac audio streams by using the AudioQueue framework: AudioStreamer.
If you also need to play wma audio streams you have to use the open source FFmpeg library. Decoding wma audio streams with the FFmpeg library is not that hard but integration with the AudioQueue framework for playback is not that straightforward.
If you are familiar with handling this problem in a web app, you could try having a UIWebView in your app.