Sensor Fun: Creating a simple audio recorder/player
Sound recording and playback is really simple using the MediaRecorder and MediaPlayer classes .. see the example below .. Sample App First some layout .. a button to start/stop recording and a button to play the recorded stuff (main.xml): <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:id="@+id/output" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="" /> <Button android:text="@+string/record" android:id="@+id/btRecord" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button> <Button android:text="@+string/play" android:id="@+id/btPlay" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button> </LinearLayout> Adjusting the externalized strings in the strings.xml <?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">Soundrecorder Tutorial</string> <string name="record">Record!</string> <string name="play">Play</string> </resources> ...