Find Jobs
Hire Freelancers

Continuous recording in smallest file size. AudioRecord or MediaRecorder?

$30-250 USD

Closed
Posted over 9 years ago

$30-250 USD

Paid on delivery
I am developing an Android application. In this app, 2 users talk to each other (simulating normal phone call). At the side of 1st user, the app records using AudioRecord and sends recorded audio to the server. At the other side, the app will download these files and play them using AudioTrack. This process is continuous; which means I keep recording and sending while the user is still talking. Everything is working fine but I have a problem with the size of the files to upload. I did not find a way to control the size of the recorded files. The whole problem can be solved if I can find a way to tell the audioRecord to use for example: setAudioSamplingRate(low), set lowAudioEncodingBitRate(low), setOutputFormat(OutputFormat.THREE_GPP), setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB). I know we can use these with MediaRecorder, but I have to use AudioRecord because I want to analyze the sound before sending it. Here, we have 2 solutions: i) either to use MediaRecorder instead of AudioRecord (but can we keep recording in continuous way so that no sound will be lost?) ii) or we find a way to tell AudioRecord to use the low-resolution settings I don't care about the quality of the sound, I want the cheapest in terms of file size. Find below my code: Recording int frequency = 11025; int channelConfiguration = AudioFormat.CHANNEL_IN_MONO; int audioEncoding = AudioFormat.ENCODING_PCM_16BIT; int bufferSize = [login to view URL](frequency, channelConfiguration, audioEncoding); AudioRecord audioRecord = new AudioRecord([login to view URL], frequency, channelConfiguration, audioEncoding, bufferSize); DataOutputStream dos = getDOS(); int bufferReadResult = [login to view URL](buffer, 0, bufferSize); for (int i = 0; i < bufferReadResult; i++) [login to view URL](enc(buffer[i])); //Upload file to the server Playing //download from server, then ... int intSize = [login to view URL](11025, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT); final AudioTrack aud = new AudioTrack(AudioManager.STREAM_VOICE_CALL, 11025, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, intSize, AudioTrack.MODE_STREAM); short[] arr = SoundFile2Array(f1); [login to view URL](arr, 0, (int)([login to view URL])); What I need is a way to Record sound to an array. Then i analyze / change data in this array, save it to a file, upload the file, then download it at the other side, retrieve original array, and play it. I could do all of this and it is working very well. All what I need is a way to minimize the file size. I want a way to tell the audioRecord to record using 3gp format, for example, or any other cheap format. Again, I want to keep recording and lose nothing. I want to record and send while the user is still talking. The app should keep recording without losing any audio. I don't want to record and save to a file. I want to record, get an array, play with it, save it to a file, and upload the file. All of this has been successfuly done. I tried to zip/compress the file that includes the manipulated array, the compressed file was only 10% smaller.
Project ID: 6687336

About the project

2 proposals
Remote project
Active 9 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
2 freelancers are bidding on average $227 USD for this job
User Avatar
hi, I can do this job . So much jobs here on freelance and bids, and little responces... will correctly estimate after you just shoot a message to me. About experience: i have job history on eLance_peopleperhour_oDesk coms. I have done such app but only fo recording dial ta;k and saved it in 3gp format. Regards,Iskandar
$277 USD in 7 days
4.8 (4 reviews)
4.2
4.2
User Avatar
You can create in your app a comprimer and it will comprime automatically for you...But it's not that simple to do that..Let's just have a conversation and see what we can do!I can start right now!
$177 USD in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of LEBANON
Beirut, Lebanon
5.0
1
Member since Nov 25, 2009

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.