How to Make custome record view Meter?

喜欢而已 提交于 2019-12-13 05:49:36

问题


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

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?


回答1:


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();
}
}
}
}

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>


来源:https://stackoverflow.com/questions/9442975/how-to-make-custome-record-view-meter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!