如何使custome记录视图表? [英] How to Make custome record view Meter?

查看:219
本文介绍了如何使custome记录视图表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使custome观点计这为s preD当用户录制语音??

i want make custome view meter which is spred when the user record the voice??

有谁为录制音频知道的数字VU表的任何编码的例子吗?

Does anyone know of any coding examples of a digital VU Meter for recording audio?

有谁知道的用于显示正在录制的内容时,反馈任何编码的例子吗?

Does anyone know of any coding examples for showing feedback when a recording is being made?

推荐答案

这是一个Mediastore文件意味着录音。就像按一下按钮,开始记录

This is a Mediastore file means Audio Recording .just like click the button and start the recording

public class MediastoreActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
 Button btn = (Button)findViewById(R.id.recordBtn);
btn.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View view) {
startRecording();
}});
}
public void startRecording() {
Intent intt = new Intent("android.provider.MediaStore.RECORD_SOUND");
startActivityForResult(intt, 0);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case 0:
if (resultCode == RESULT_OK) {
 Uri recordedAudioPath = data.getData();
}
}
}
}

这是一个mail.xml文件中创建只有一个按钮

This is a mail.xml file create only one button

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Button android:id="@+id/recordBtn"
android:text="Record Audio"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>

这篇关于如何使custome记录视图表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆