James andresakis
James andresakis

Reputation: 5415

android - return to activity after user hits stop in the default voice recorder

Im launching the default voice recorder using the following:

Intent intent = new Intent(MediaStore.Audio.Media.RECORD_SOUND_ACTION);
            startActivityForResult(intent, soundVal);

This works fine but when a user hits the stop button they are prompted to play the sound and then allow to record more. I would like for the recorder to close as soon as the user pushes the stop button and return to my activity so I can do what I need with the sound file that has been created. Is that even possible? If not then I guess I would need to build my own custom recorder.

Upvotes: 1

Views: 155

Answers (1)

David T.
David T.

Reputation: 23389

I think you're right, you may need to either write your own custom recorder or maybe scan the SDCard to see if you can find the file (risky).

To write your own custom recorder, you have several options:

  1. find an open source one, depending on the license, include as library in your app
  2. write your own from scratch (may take a while, and have bugs you didn't think about)
  3. reverse engineer an existing one, using Eclipse, decompiler, and dex2jar

the other choice you COULD try to do is to monitor the SDCard, and if there's been any new sound files that was recently added, you'll know it's most likely from the default voice recorder... however, this approach is a bit limited in that some devices don't write out their voice files to SDCard (although i think most do).

Upvotes: 1

Related Questions