Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Self-Destructing Message Android App Capturing Photos and Videos Taking a Photo Using an Intent

Audio Implimentation

Hey Guys -

I have just finished building the entire app. I am hoping I could get some help modifying the code and files to push an audio recording across and then delete it. I would like to get rid of the video and picture feature and just use the audio input.

If anyone could assist with this it would be tremendous.

Thanks

  • Mike

1 Answer

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

It should be fairly straightforward. You'll capture the audio in a file, and then you can use the same code to send and store the file on the back-end. It will be a ParseFile that will hold the audio file instead of an image or video.

To record audio, check out the documentation from the Android developer site: http://developer.android.com/guide/topics/media/audio-capture.html

Then you'll need to play the audio when a message is tapped on in the inbox. We covered playing audio files in the Crystal Ball project, so you should be able to adapt that code that uses the MediaPlayer. There's also information about this in the Android developer guide linked above.

Good luck!