I am creating an app, which is based on music composition. In this App, a .mp3 song is playing in the background and the user can add their voice with this music and save the recorded music file. I am using media recorder and media player for recording and playing, but my recorded file is not suitable for my app.
The android.media.MediaPlayer class is used to control the audio or video files.
MediaRecorder class can be used to record audio and video files.
You can set output format like this...here 3gp example i am giving you
Mediarecorder recorder;
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
Related
Let say I have a wav file local, it is kind of beat music, and then I play this file using ExoPlayer, I also sing a song at the same time. Is there any way to record audio at that time?
Then the recorded audio will include my voice and the beat music.
I have mute video file and separate audio file for same video. How can I play video with separate audio in android? I have tried using VideoView but unable to play audio separately. can anyone help in this!!
Before you start everything running, first you prepare both video and audio. When both of them are prepared only after that you can push the Start button.. and they should be synchronized ( if you recorded the audio part at the same time you started the video part)
I want to play the audio recorder file while recording progress.
OR
Any other way to play the sound while recording
You are getting echo because you are playing the audio through main speaker while recording.
Try to listening to the audio thru headphone while recording thru built in mic.
Also let me know the changes you made to accomplish the main task.
I am developing a project in which i need to play Audio and Video files. When audio player is clicked i should display only audio files from sdcard and play those files.
When video player is clicked i only need to display video files and play those video files.
I am using media player for playing the files.
MediaPlayer mp = new MediaPlayer();
String filepath = Environment.getExternalStorageDirectory()+"/f.mp3";
mp.setDataSource(filepath);
mp.start();
But My problem is,how to browse the audio/video files and set the data source dynamically when the user selects a particular file.
You Should use MediaStore which has separate ContentProvider for audio and video
http://developer.android.com/reference/android/provider/MediaStore.html
Audio : http://developer.android.com/reference/android/provider/MediaStore.Audio.html
Video : http://developer.android.com/reference/android/provider/MediaStore.Video.html
I am developing an application in which I have to perform three functions play, record and pause an audio file.
Has anyone implemented it before?
Take a look at MediaPlayer or AudioTrack for playback. The difference is that MediaPlayer can play several audio formats directly from file (or in some cases even from remote URL), while AudioTrack plays only from raw LPCM buffer,
For recording take a look at MediaRecorder or AudioRecord. The difference is that MediaRecorder records audio and video to .3gp, while AudioRecord gives you only audio as raw LPCM buffers. The AudioRecord data can be used to create .wav files (though some extra code is required for this).