我在XML布局文件中设置了“播放”按钮,
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="play"
android:onClick="playButton"
/>
我想这样做,当我点击按钮时,会出现一个动作对话框,其中有两个按钮,分别表示“播放”和“停止”。
当我点击“播放”按钮时,我希望应用程序记录用户对麦克风所说的内容,当按下“停止”按钮时,将该mp3保存到资源中。
我该怎么做?我现在真的很困惑,因为我和是的,我在Media Recorder上看过Android文档和示例代码而我仍然没有得到它......
试着在Github上找到这个资源android-MediaRecorder制作类似你亲爱的东西,但是使用相机的设备。顺便说一下,你可以从这里开始做一些调整
顺便说一句,你可以找到更多像这样的项目,例如这个AndroidAudioRecorder
已经做到了。
也许这可以帮到你
干得好!