Convert .mp3 file to .wav or .caf in code in iOS - ios

I am retrieving an MP3 file from the iPod Library and saving it to the application's Documents directory. I need to convert it to .wav or .caf so that I can use OpenAL or any other library to change the pitch of the audio.
Can this be done? Any assistance with code will be greatly appreciated.

Take a look at the AVAssetWriter class. Also, check out this link, its not exactly what you want, but its a start.
http://www.subfurther.com/blog/2010/12/13/from-ipod-library-to-pcm-samples-in-far-fewer-steps-than-were-previously-necessary/
Note that it might be difficult to gain access to the user's actual file as that would require reaching out of your app's sandbox - something Apple doesn't allow.

Related

Convert .caf audio file to .wav audio file swift

I have recorded audio and saved in .caf format in document directory. I need to convert the .caf to .wav file to upload the file to server. I researched and didn't get much input in swift. Please help me out to find a solution?
Did you try AudioKit?
Maybe you can use AKConverter https://audiokit.io/docs/Classes/AKConverter.html

Can I extract or convert a video file to audio?

I have a case where i need to get audio out from video file. Is this possible in iOS ??
I need only the output file as an audio any type. I have the video file in my documents directory which I record earlier in application.
1.Convert Video Reverse
2.Extract audio from a video file
3.Add Audio & Video Together
Download Code From Here
may be helpful to you.
Yes, it can be done. See Extract audio from video file for ideas.
Extracting is probably the more accurate term.

Convert .Caf file to more standard format programatically in iOS

I know this has been asked around, but couldn't find a straight answer.
My App uploads .caf files from ios to Webserver, where .caf isn't a recognized format. What Should I do programatically in iOS to turn it into mp3, .wav..etc before uploading to server?
EDIT : I had the same problem and solution is given below
I had same issue, As .caf isn't a recognized format in ISS 6.0 or greater (not sure about which ISS) so u convert into base64 then save in server as .cab file
When retrieving again convert form .cab to .caf file
I couldn't find an easy way to do this. So, I ended up downloading caf players on my windows machine.

Create AAC file programmatically in iOS?

I am creating an iOS app that can play instrument sounds.
The user can play and record his melody.
Now, I need some help to export his record into an AAC file.
Any idea ?
Thanks ;)
Here is a great project that does exactly that by Michael Tayson
you could think about starting with LPCM and then convert this down to AAC.
Have a look at Apple's 'Audio Converter Services Reference' specifically the following:
AudioConverterFillComplexBuffer

Can you add ActionScript or other code to an flv

I'm curious if it's possible for an flv file to contain code like ActionScript or if it can only contain the audio/video data for the video.
I'm specifically asking related to the security of allowing an FLV file to be uploaded a site.
Edit: assume that the contents have been validated to be a real "flv" - the question is whether the format natively supports code inside of the flv.
the question is whether the format natively supports code inside of
the flv.
To that question, the answer is no. For further security discussions, see the other answers.
FLV files are for video/audio: http://en.wikipedia.org/wiki/Flash_Video. but I can rename any executable file of course and add the .FLV extension to it. so I believe you will need to read the uploaded files and check whether they are FLV indeed.
FLV is only a video format. Like akonsu said, you should check if the file is really a FLV file, not just checking it's extension.
You should check if the file's mime type is "video/x-flv".
More info about FLV: http://osflash.org/flv

Resources