media-player

How to set up Streaming audio with MediaExtractor and MediaCodec?

依然范特西╮ 提交于 2019-12-04 07:59:11
I am trying to stream incoming AMR_NB. I can't use MediaPlayer directly because it requires a seekable file. I would like to use MediaCodec, but to use MediaCodec I need (I think... please correct me!) MediaExtractor to give me things like the presentationTime. Is that true? Can I use MediaCodec without MediaExtractor? MediaExtractor seems to require seekable files. The documentation only specifically says so for one of the setDataSource operations but when I tried to use any of the others it failed due to failed seek attempts. So, what can I do to get my incoming AMR stream to play? I am

How to calculate the audio amplitude in real time (android)

谁都会走 提交于 2019-12-04 07:51:39
I am working on an Android app where I need to calculate the audio amplitude in real time. As of now I am using MediaPlayer to play the track. Is there a way to calculate its amplitude in real time while playing it? Here is my code: int counterPlayer = 0; static double[] drawingBufferForPlayer = new double[100]; private byte[] mBytes; private byte[] mFFTBytes; private Visualizer mVisualizer; public void link(final MediaPlayer player) { if(player == null) { throw new NullPointerException("Cannot link to null MediaPlayer"); } // Create the Visualizer object and attach it to our media player.

Audio Crossfading in Android

廉价感情. 提交于 2019-12-04 07:41:07
I am develping a media player for my learning purpose and I want to have crossfading feature in media player app. But I don't have clue where to start from. i tried searching on inernet but no luck. I am using Android MediaPlayer class for all media player related operation. Anyone know any workaround to achieve the same. thanks for your support Try to use the AudioTrack instead of MediaPlayer. Generally, I'd suggest the following plan: Learn some sources for an app that uses AudioTrack. A good player can be found here This is an aac audio player that uses JNI for aac-audio decoding. Find a

how to use ijkplayer library

左心房为你撑大大i 提交于 2019-12-04 06:50:38
I'm going to use ijkplayer github link . I downloaded this and then import it to eclipse by File > Import > General > Existing Projects to Workspace. After that I have three project: 1.ijkmediaplayer ( library ) 2.ijkmediawidget ( VideoView-like interface ) 3.ijkmediademo ( Demo project ) When I run ijkmediademo, Error happened and program crashed. I got these lines of error: 07-06 14:06:26.913: E/AndroidRuntime(11394): FATAL EXCEPTION: main 07-06 14:06:26.913: E/AndroidRuntime(11394): Process: tv.danmaku.ijk.media.demo, PID: 11394 07-06 14:06:26.913: E/AndroidRuntime(11394): java.lang

Android AudioRecord and MediaRecorder

巧了我就是萌 提交于 2019-12-04 06:14:05
I'm developing an audio processing application where I need to record audio, and then process it to obtain features of that recording. However, I want the audio in a playable format to play it after with MediaPlayer. I've seen that to record audio to process it it's better to use AudioRecord, because I can get the raw audio from there. But then I can't write the data to a file in a playable format (is there any library to do this in android?). I used this method to record raw data and then write it into a file: http://andrewbrobinson.com/2011/11/27/capturing-raw-audio-data-in-android/ But when

android:play audio files using single mediaplayer object and also display images

依然范特西╮ 提交于 2019-12-04 06:02:37
问题 i need to display images and play corresponding audio files one after the other. i tried to create multiple media player objects but it shows error(1, -17) so plz help guys i am running out of time. Right now i have a handler which plays audio file and then get the duration of that audio file while playing another audio file this is my approach but i am unable to play some 10 files below is my sample code img.setBackgroundResource(R.drawable.d002_p001); d002_ae_p001 = MediaPlayer.create(this,

UDP Video Streaming on Android

被刻印的时光 ゝ 提交于 2019-12-04 05:24:10
I have an Android project where I need to build a client app to receive UDP or RTP unicast video streams and play them back. Unfortunately, I cannot seem to get this working and have searched extensively for a solution! I have being testing on a Xoom (Android 3.2) and a Nexus S (Android 2.3.6) and know that they can play the content when using MX Player (a third-party media player app) as the client but I can't get the native media player to play back the content. I have tried using both a simple VideoView and a MediaPlayer but both fail with the same error code and I can't really find any

Android Visualizer FFT / waveform affected by device volume?

爱⌒轻易说出口 提交于 2019-12-04 05:00:36
I'm working on some music analysis using the Visualizer class on Android 2.3.1. I am finding that the FFT and waveform magnitudes are affected by the volume of the device. This means that if the user has the volume turned down I receive little or not FFT data. I've tested this on a Motorola Xoom, Samsung Galaxy Tab and the emulator and it behaves this way. I am using the code below: mp = new MediaPlayer(); mp.setDataSource("/sdcard/sine1.wav"); mp.prepare(); mp.setLooping(true); mp.start(); int audioSessionID = mp.getAudioSessionId(); v = new Visualizer(audioSessionID); v.setEnabled(true);

Android Media Player Wont Play After Stop

﹥>﹥吖頭↗ 提交于 2019-12-04 04:44:17
I have music playlist for 5 songs. I just want that play and stop buttons work as long as im in app. And that i can stop music when i want to and start another. How this works now...The music plays on PLAY button, and when i click STOP button it stops, but then i want to play some other song, or same song again, nothing happens. Please help. public class glavna extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final MediaPlayer MPRadio1 = MediaPlayer

how to get bit rate , sampling rate and no. of channels of a audio file in android

徘徊边缘 提交于 2019-12-04 04:22:40
I need your help for the below query: Query: Is there any way of getting following info of an audio file. Sample rate, Channel, Bitrate of an audio file. For extracting bitrate, "MediaMetadataRetriever" API is available (METADATA_KEY_BITRATE). Please suggest if it can be done using any android API. Found this below API, But its use is actually in different. http://developer.android.com/reference/android/medi/AudioTrack.html I want to extract these using Android API programmactically : Sampling rate, Quantization, Channel of an input audio file. Please help on this. Thanks in advance. Use