MonoTouch: Record audio in compressed format like .m4a - xamarin.ios

I tired this example:
http://wiki.monotouch.net/HowTo/Sound/How_to_record_sound_using_the_iPhone_microphone
But when I change the AudioFileType, from a compressed type (MP3) the file size is the same as WAVE.
Am I doing something wrong?
Thanks.

This is the list of encoders exposed by iOS:
http://developer.apple.com/library/ios/#qa/qa2008/qa1615.html
And it does not support MP3 encoding
This was previously discussed here:
iPhone - AVAudioRecorder - how can I record to an mp3?
The only alternative is for you to include your own MP3 encoder and negotiate directly with the MP3 patent holder the terms.

Related

How to write a webm (or other) audio/video block of data from MediaRecorder to a properly formatted .webm (or other) container file?

I am using javascript to capture audio data from MediaRecorder, and base64 encode it so I can send it back to the web server where it can be saved for later playback.
data:audio/webm;codecs=opus;base64,GkXfo59ChoEBQveBA...(too much data to post, but you get the idea)
I can put that data into an HTML5 audio element's .src field, and play it back on a Chrome browser just fine. But Safari can't handle the data in that format, I guess it doesn't support the opus codec.
One solution for me would be to figure out how to write the audio data into a properly formatted .webm container file, and then use ffmpeg.exe to convert it to some other Safari friendly format.
But I don't know the file format for .webm file - I'm looking for tips or guidance how to write such a .webm file.
Anybody have any suggestions, libraries, or tips to write data like above to a .webm file? I prefer a C# .net answer, but javascript will also do, or any examples are appreciated.
Well, I got a tip from smart developer (earnabler) that if I stripped off the header portion of the content:
"data:audio/webm;codecs=opus;base64,"
and decoded just the base64 portion:
"GkXfo59ChoEBQveBA...(too much data to post, but you get the idea)"
...back to binary (example in C#):
byte[] decodedBinaryData;
decodedBinaryData = Convert.FromBase64String(encodedBase64String);
...and wrote that binary to a file with a matching file extension (.webm in this example), that the file would be a properly formatted file of that type understandable by other media software.
Lo and behold, it was! I could play the file in MediaPlayer, or QuickTime, or whatever, and could use FFMPEG to convert it to other types.
So that gives me a pathway to save/use/convert the media in many ways. Problem solved.

C# MP4 video creation from images and mp3 file

I am creating videos from series of images with an audio mp3 using splicer (http://splicer.codeplex.com/). The output for this is avi and use ffpmpeg to convert to mp4.
Is there any api for c# to create mp4 from series of images and mp3 file. I need to add some animation as well like Ken Burns style this time.
DirectShow Editing Services - best way. Or DirectShow using push source filter sample to generate frames. In both cases MP4 muxer, H264 and AAC encoders required.
Codecs can be purchased from Elecard for example - http://www.elecard.com/en/products/development/sdk/codec-sdk.html .
Alternative commercial solution to create video from images and encode to MP4 using a few lines of code - http://www.visioforge.com/video-edit-sdk-net.html .

How to programmatically convert .rm (RealPlayer Media) file to MP3 or another format?

I would like to convert .rm (RealPlayer Media) file to MP3 or another format?
First, I successfully managed that using VLC but the quality was not good. Then I tried the Real Alternative codec with DirectShow, this also worked ok, but then I found that the codec is no longer developed because RealNetworks sued the developer.
Now, I have installed the RealPlayer and I am trying to use it's DirectShow filters to convert .rm to .mp3 but without success:( (Actually after adding RealPlayer Transcode filter and choosing a file the GraphStudio crashes.)
Is there a legal way to programmatically convert .rm file to another format? How to make RealPlayer to programmatically convert files? Do you have any hints or examples, how to use RealPlayer Transcode filter? (I am new to DirectShow.)
UPDATE to make the question more concrete: How can I list implemented interfaces and its members of RealPlayer Transcode filter? I have not found any documentation:( (The GraphStudio says it has 0 pins and just common properties.)
You need to build a DirectShow graph to read and decode .rm, then compress audio into MP3 and write it into a file. This is similar to recompressing an AVI file, described in some detail on MSDN: Recompressing an AVI File. You just have audio without video there, and the container formats are different.
UPDATE: There is no way to reliably list implemented interfaces in COM. Sometimes you can find this out by checking the type library, however a lot of DirectShow filters are coming without it. Typically, you need an SDK header file from the filter vendor to get a definition of implemented so called 'private' interfaces.

how to write mpeg4 file in vc++ directshow

hai..
Am writing application for capture video from camera in vc++ using directshow and write that
file in WMV format.and how to write MPEG4 file format.can i install any sdk for mpeg4.can you provide details about mpeg file writing in vc++
kindly help me
thanks
I'm not entirely clear if you want to change the video format or just the container format. If you just want to write the existing camera output into a different container file, then you need a multiplexor filter. There's an MP4 multiplexor filter available in source form at www.gdcl.co.uk/mpeg4. If you connect your camera's output to this filter and then the file writer, you should be ok.
If, on the other hand, you need to encode the camera output to mpeg-4 video as well, then I think you will need to licence a third-party encoder filter.
G

Is there anyway to get ID3 metadata from an MP3 or Vorbis comments from Ogg via the HTML5 audio element?

Mozilla Developer Center's HTML5 media guide describes an event for audio and video elements called "loadedmetadata". Is there anyway to get the metadata for files? I am writing an HTML5 extension for Google Chrome and I don't know what the metadata for the audio files I'm creating a player for beforehand.
Edit: This question seems to be kicking everyone's ass. :/
According to this you can use filereader.readAsBinaryString(file); to get the binary data of the ID3 tag.
filereader.readAsBinaryString(file); will asynchronously return a binary string with each byte represented by an integer in the range [0..255]. This is useful for binary manipulations of a file’s data, for example to look for ID3 tags in an MP3 file, or to look for EXIF data in a JPEG image.

Resources