Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7555683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:40:19+00:00 2026-05-30T11:40:19+00:00

I have a very simple Activity to record audio using MediaRecorder . Basic start/stop

  • 0

I have a very simple Activity to record audio using MediaRecorder. Basic start/stop functions

// start
recorder.prepare();
recorder.start();

// stop
recorder.stop();
recorder.release();
recorder = null;

I pass the output file to Google App Engine via org.apache.http.client.methods.HttpPost in a Blob datastore.

// AsyncTask doInBackground
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(DEV_SERVER);
ByteArrayOutputStream outstream = new ByteArrayOutputStream();
MultipartEntity reqEntity = new MultipartEntity(
    HttpMultipartMode.BROWSER_COMPATIBLE);
ContentResolver cr = getContentResolver();

InputStream audio_is = cr.openInputStream(working_uri);
int nRead;
byte[] data = new byte[16384];
while ((nRead = audio_is.read(data, 0, data.length)) != -1) {
    outstream.write(data, 0, nRead);
}
outstream.flush();
ByteArrayBody body = new ByteArrayBody(outstream.toByteArray(),
    POST_TEMP_FILENAME);
reqEntity.addPart("uploaded", body);
httppost.setEntity(reqEntity);
httpclient.execute(httppost);

The result is a full file on the sdcard, but when the file is stored on the server it is corrupt.

Is it possible I’m not reading the bytes correctly? Or is it more a matter of Google App Engine not storing the Blob correctly?

Here is the receiving python code:

def post(self):
    entry = models.Entry()
    entry.content = db.Blob(self.request.get("uploaded"))
    entry.put();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T11:40:20+00:00Added an answer on May 30, 2026 at 11:40 am

    Turns out everything was working just fine. It was my desktop player VLC that wasn’t decoding the file correctly. AMR/3GP audio is horrible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a very simple android activity that starts a timer when you
I have a very simple WPF application in which I am using data binding
I have been trying to integrate my very simple voice recorder app with the
I have a very simple VB.net Windows Service written using VS.net 2008. The program
I have an application that contains a main Activity, which has a very simple
i am having a very simple problem. I have created an activity in which
I have a very simple Activity with the following layout... <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent
I have a very simple game that consists of only one activity, and I
I have a very simple Android activity layout like this: <?xml version=1.0 encoding=utf-8?> <LinearLayout
Hopefully this is very simple. I have a central activity that can be launched

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.