Using afconvert from iOS - 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.

Related

How to convert convert .CAF file into .MP3 in 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.

Samples/file extensions supported by iOS sampler

I'm writing an iOS app which can play MIDI and output its content using the AUSampler and AUGraph classes. I know for sure it supports files like Soundfont (.sf2) but this one seems to be quite antiquated.
Question: Are there any other files or sample types which this framework supports?
Thanks.
The AUSampler also supports DLS format (.dls) and AUpreset format (.aupreset)

OpenCV. How to identify i-frames only for a video file encoded in MPEG format

I need to extract only the i-frames from an MPEG encoded video file(it may be a .avi file or .mp4 file). Is it possible to atleast identify the i-frames.
It looks like this ffmpeg enhancement can accomplish this for you using the select filter to filter all I-Frames. You may need to build ffmpeg from source to get this capability I'm not sure. Here is an Ubuntu guide with the details, and here is where you can get the nightly Windows binary version.
EDIT: OpenCV relies on ffmpeg API's to capture video from a file. However, the functionality you want is a bit specific, so you are going to need to write your own custom filtering module with ffmpeg's libavfilter. Here is one of their how to guides on using libavfilter. In particular, as I mentioned above, you will probably want to use the select filter provided by libavfilter. This will filter all I-frames from the stream for you to process.
Hope that helps!

Where can I find a file/struct layout for a tcpdump() file?

We are capturing packets to a file using tcpdump(). I need to write a program to parse it, does anyone know where I could find a file layout for a dump file created by this tool?
tcpdump uses libpcap; there are docs describing the libpcap file format which should give you what you need.
The easiest way to parse the file is to read it with libpcap; libpcap can be used directly from C and C++, and there are wrappers for a number of other languages. That way you don't have to know what the file layout is (and you will also be able to read at least some pcap-ng files if your program is using libpcap 1.1 or later).

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