Create mp3 from mic audio input - objective-c

I have a Mac app communicating with a web service that can only deal with mp3 files. I found out after hours of debugging that kAudioFormatMPEGLayer3 is decode only. So, I need to either take the resulting audio data and convert it straight to mp3 or convert it to AAC or some other supported format to mp3. Compatability with iOS is not a concern.
Also, please don't recommend LAME the license is not acceptable for this particular case. And any code demos would be greatly appreciated.

MP3 is a patented file format. You can't just write an MP3 encoder and stick it in your app unless you pay a licensing fee.
http://mp3licensing.com/royalty/
Your best bet is to stick with the built-in AAC encoding.

Related

Characteristics of the audio file played by RestComm Media Server

We are having some problems playing Wav files in RestComm: some of them play nicely but others sound very weird.
8KHz
16bit
https://www.dropbox.com/s/34mmlbopdoc3uox/record_welcome16b.wav?dl=0
Is there any place where we can consult the supported specifications of the file?
Please try with A/U Law, Sample rate of 8000Hz, bit rate of 8, Mono channels.

how to get Dash segments of .mp4 video file

I have mp4 video file,which i need to load on my page,i am using MSE for that,but i don't know how can i get my video in segments with .m4s extensions,with header.m4s as parent segment with all information about my video file stored in it?Please help.
I believe that if a video is embedded on the website, it can be downloaded.
The only thing you could do is make it difficult for download.
This might be helpful. It says using a flash video is a good option to make downloading videos a bit difficult. Never used it but you could give it a try.
To protect the video, you should probably not try to artificially obfuscate the video loading. MPEG DASH supports encrypted MP4 video and common encryption (CENC), that could be a thing you can look into.

Convert from AIFF to AAC using Apple API only

I am creating a movie file using QTMovie from QTKit and everything's working nicely. The only problem I have is that the audio in the resulting MOV file is just the raw AIFF hence the file size is larger than I'd like. I've seen plenty about third party libraries capable of encoding to AAC but are there any Apple APIs which I can call to do this job? I don't mind converting the AIFF to AAC prior to adding it to my QTMovie or having the encoding done as part of writing the QTMovie to disk.
This was actually easily achievable using QTKit. I just needed to set the QTMovieExportType to 'mpg4' and QTMovieExport to be YES when calling writeToFile:withAttributes:.

Record audio in OS X into FLAC using Cocoa

I am trying to record audio from a microphone/iSight camera from Mac to a NSData object.
I have tried to do it using QTKit, but I found out that you could only save it as a .mov file.
But the fact is that I want to recode the audio into a FLAC file. Is that posible, or I'll need to use another framework?.
Thanks.
Grab the source for VLC (if you can deal w/GPL -- it has limitations on use that many find onerous) and have a read. It does transcoding, amongst other things.
Beyond that, one dead simple approach is to save as AIFF and then use a command line tool (via NSTask) to do the conversion.
Or you could just go with Apple Lossless -- it is open source these days.
Of course, this also begs the question; why do you need lossless compression when recording voice [low bandwidth in the first place] via a relatively sub-par microphone?

Streaming encoded video in Adobe AIR Application

I am developing a desktop application in Adobe AIR that will be used to stream the user's camera video to a wowza media server. I want to encode the video on the fly, means transmit the H.264 encoded video instead of the default flash player encoded video for quality purpose. Is there any way around for this?
Waiting for the help from people around,
Rick
H.264 encoding is usually done in Native Code C or C++ because it is a cpu
intensive set of algorithms. The source code for x264 can give you an
idea of the code required but it is a tough read if you start from scratch.
Here is a book to get you started or you can read the original AVC standard
if you suffer from insomnia.