add exceptions and use audioRecord instead of MediaRecord