How to convert convert .CAF file into .MP3 in iOS? - ios

I am recording audio file. It is recorded with .caf extension.
How can I convert this format into .mp3 format?

There is a open source project lame . The challenge would be making it work for iphone. This would give a direction towards cross compiling for ios.
There is also an iOSMp3Recorder available on GIT and one another example
Record and audio conversion in internet.
I hope above examples may help you.

Using Lame, you can do this. Ther is no default function for this. It will also reduce the file size also. For 60 second audio file .caf will take approx 5mb - 10mb but after converting to .mp3 it will take 0.6mb to 0.7mb. Set 'Enable Bitcode' to 'NO' in build setting for new xocde, otherwise you will get error.
For sample code use this LINK.

Related

Keep original creation & modification timestamp while exporting with quicktime using applescript

I realized that my GoPro videos are very large and that I can compress them by around 80% by loading the video in Quicktime and exporting the video in the 1080p format.
I found this automation for my problem: applescript to batch export with quicktime pro
Unfortunately, I use to batch rename my video files according to the date & time taken (e.g. "2022-10-12, 15.24.13.mp4"). For the compressed video file, the creation & modification timestamp is not copied from the original file.
Any idea, how I can keep the original creation & modification timestamp for the compressed file? Or copy the creation & modification timestampe later from the original file into the compressed file? Maybe it helps that the files are named similarly except that the extension changes from "mp4" to "mov".
Thanks a lot in advance for any help!

Write metadata to mp3 local file

I´m reading metadata from mp3 file, by this way iOS AVFoundation: How do I fetch artwork from an mp3 file? and works perfectly.
when the file is mp3 and doesn´t have artwork, or title, i'm getting NULL values.
I need, when the file haven't metadata like artwork or title, to write my own metadata in the mp3 file, put my own artwork and my own title.
How i can write metadata in mp3 local files on iOS7?
Thanks in advance.
Well as no one answered.
I found the solution, I including this library in the project: https://github.com/rjyo/libid3-ios, which allows you to edit the ID3 tags of any mp3 file.
Some modifications I had to do to make it work properly with xCode5 and iOS7.
Instead - Step 4 (Quick Start (Xcode 4) repo instructions):
Add the following to Link Binary With Libraries list
libiconv.2.4.0.dylib
Libstdc++.6.0.9.dylib
libz.1.2.5.dylib
libid3.a
Once you've successfully added the libid3-ios libraries in your project, read this question iOS use ID3Lib to edit ID3 tags from mp3 files in the NSDocsDir, for understand the libid3 API faster.
Remember you should use .mm extension instead of .m for objective-c containing c++ code.

Using afconvert from iOS

Does anyone know if it is possible to convert a sound file in the Documents directory from within an app? I have a recorded sound file that will be available in iTunes File Sharing that I need to convert. Is afconvert available from within iOS?
Thanks
I'm not sure from what format to what format you want to convert to, but converting audio during runtime is not as simple as the command-line afconvert tool.
Check out Apple's sample projects iPhoneACFileConvertTest or ConvertFile. I think these would be good starting points if you want to convert audio in your app.
For what it's worth, afconvert is just a handy command-line interface to the features of the ExtAudioFile API which you can find in -- Using this API you can convert from any supported file format/audio format combination TO any supported file format/audio format combination.

How to Play mp3 file from memory in delphi?

I am downloading a mp3 file from the internet to memory using InternetReadFile. This works great, I can dump the file on disk and then play it, but I want to play the file without dumping it on disk.
Is there a library i can use to achieve this functionality ? Some docs on how to use the library would be useful too.
Thanks in advance.
You can use the BASS Delphi audio library
On the other side, search for "MP3" on the 3D Buzz site. They have a very good series of video tutorials that walk you through the creation of your own MP3 player in Delphi using this library.

Ruby/Rails Audio Conversion Plugins?

I am looking for a good gem/plugin to convert user-uploaded audio files to different formats. One format in particular that I am interested in is converting to Apple .caf with ima4 compression for inclusion in an iPhone app.
I have been using afconvert on my mac for this so far, but I need to do it on my linux box, server-side. Ideally, I would be able to work into paperclip.
As an additional solution, ffmpeg could work, but I have not seen any .caf options for it. Anybody know of one?
The Sound eXchange project supports lots of audio file conversions. I've used this in the past to convert aiff files output by the OS X "say" program to ulaw files for Asterisk. This yields rather nice text-to-speech. For my purposes, I also found a Ruby extension on github called sox-ruby that wraps the libsox functions directly.

Resources