Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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!