You should use AudioRecord
for recording and AudioTrack
for playback if you want raw bytes. MediaRecord
will give an encoded audio format.
There are plenty of example online if you search for AudioRecord, so I won't go into the details, but it's not very complicated.