I am working on capturing and streaming audio to RTMP server at a moment. I work under MacOS (in Xcode), so for capturing audio sample-buffer I use AVFoundation-framework.
You have to break sample buffer into chunks of size 1024, i did for recording mp3 in android for more info follow these links link1,links2