First, you have to change the Android HAL according to your hardware configuration. Then, a custom application should be created. For more information, refer to the Android Developer sites:
https://source.android.com/devices/audio/index.html
http://developer.android.com/reference/android/media/package-summary.html
Have a great day,
Artur
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------