I know about the AVAudioRecorder class, but I am wondering how (using Monotouch) you capture the Mic input so you can stream it to a remote server. The AVAudioRecorder class lets you save a strea开发者_JS百科m to a local file. Is there a way to pass a URL or get the byte data before it's sent to the local file?
You can use the lower-level APIs in MonoTouch.AudioToolbox to assemble any kind of audio pipeline you need.
There is a sample for decoding and playing back streaming audio in:
https://github.com/xamarin/monotouch-samples/tree/master/StreamingAudio
This is useful merely to give you an idea of how you process samples. The idea is very similar, but you would be using the other side of the API to extract and upload the data.
This is Apple's guide to capture audio with AudioToolbox:
http://developer.apple.com/library/ios/#documentation/MusicAudio/Conceptual/AudioQueueProgrammingGuide/AQRecord/RecordingAudio.html#//apple_ref/doc/uid/TP40005343-CH4-SW1
That documents the C API, which we have provided a high-level binding in MonoTouch for.
精彩评论