Close Sidebar

stream audio to http-post in Android

0 votes
2,735 views

I'm trying to

  1. record voice from an Android device,
  2. have the data encoded as some audio encoding (M4A, FLAC, Ogg)
  3. stream upload it to my server (chunked http post) - while the recording is ongoing.

Any ideas how to achieve these ?


I tried to do use Android'* MediaRecorder (which records audio, encodes it and saves to File) and to use Android'* HttpClient with InputStreamEntity which allows uploading data from an input stream. I used "StreamingLoop" from https://github.com/Teaonly/android-eye/blob/master/src/teaonly/droideye/StreamingLoop.java to connect the output file descriptor to the inputStream so I could use the MediaRecorder'* output for the HttpClient'* input.

However this failed - When I stop the recording I get:

06-27 17:58:47.259: A/libc(6759): Fatal signal 11 (SIGSEGV) at 0x00000010 (code=1), thread 6759

which crashes the application, and the file that arrives to the server is unplayable by VLC, so this is twice a failure.

Any ideas for a different method to do requirements 1..3 above or how to debug it?

asked Jul 6, 2013 by ugochimbo (860 points)

Please log in or register to answer this question.

  1. Login or Register

    Click to open login box. Login or register from here

  2. Search Box

    Click to open the search box. You can search within the site content here

  3. Hello Admin!

    You can reach to admin section by clicking on this navigation item

  4. Ask A Question

    Start asking a question by clicking on this navigation item

  5. Find All Recent Activities

    Here you can find all recent activities recent question, answer, comment etc

  6. Vote Question or Answer

    You can give up or down vote to the question or answer by clicking on respective arrow button

  7. Give Your Answer

    Click this button to give your answer to the question

  8. Add Comment

    To post comment click on the button

  9. Select Best Answer

    Consider the answer as the best answer for your question by clicking one to the tick

  10. Congratulations!!!

    Now you learn how to use site. Why don't you start to ask a question or provide some answer to the community!

...