I want to play multiple audio files simultaneously in sync. I , file on the SD-Card, or a file in a specific folder). I want to be able to put a delay on the files and adjust the play rate.
I have looked MediaPlayer, MediaPlayer seems like the right path, but they are not synchronous multiple audio into single audio.
Related
I am working on an Android App which play MP3 songs. MP3 player seek bar is not working with some MP3 songs but it works with some MP3.
All MP3 streaming from server. All MP3 files are some.
Is it server side issue? Do I need something on server?
Is it MP3 file issue? are there any difference between in MP3 files?
Do I need any other file format?
Should I change my hosting? shared to VPS?
Are there any other android media player library for MP3?
Is it server side issue? Do I need something on server?
Could be. You didn't mention what protocol you're using, so I'll assume HTTP. In the ideal case, the client should be able to make ranged requests. Not all HTTP servers support these, which could explain the difference in behavior.
Is it MP3 file issue? are there any difference between in MP3 files?
Regular MP3 files don't contain any sort of timestamp information. It's not technically a seekable format. Players work by calculating bitrate and estimating where to seek into the file in bytes. Then, they re-sync to the stream and continue playback.
Do I need any other file format?
You can put MP3 audio in another container which is seekable.
Should I change my hosting? shared to VPS?
That's not the root of your problem, no, but your server does need to support range requests.
Are there any other android media player library for MP3?
Use the built-in system code. It's well-optimized and in some cases hardware accelerated.
I am building an Android application and I want to play multiple audio files back to back. I have a lot of audio files so I don't want to load them at once but as they are needed. I also need a way to stop the continuous playback. So as input I have a File[] array of audio files and I need a way to start continuously playing and stop. I saw MediaPlayer as a way to play the audio files but I wasn't sure how to continuously play them and stop on demand.
The Media Playback API Guide contains everything you need to know. You can also check the RandomMusicPlayer included in the Android SDK samples.
I'm trying to play a couple of short audio files (ca. 2sec) in an Android App with the Media Player. They do play, but for some of them I get a click sound at the end (which differs from file to file).
There are no click-sounds when I play it on the PC, also I tried to convert it from .mp3 in .ogg and modified the soundfiles themselves, nothing helps, I think the problem is probably the Media PLayer.
For short audio files, like sound effects, I would use a SoundPool
Also see this question and answer here: The correct way to play short sounds Android?
I'm trying to implement a 'click' sound when the user interacts with buttons in the main screen of my application. I have no experience with audio in Android, however several sources suggest that to simply play a clip, I need only do the following -
Put the audio file in /res/raw
I did this, I had to create a /raw folder within /res/ - the file is named menuclick.wav (so seems to meet the guidelines for a-z0-0_ filenames)
Create a MediaPlayer object
MediaPlayer mediaplayer;
mediaplayer.create(getApplicationContext(), R.raw.menuclick);
Prepare the player for playback (*within a try - catch block)
mediaplayer.prepare();
Play the file
mediaplayer.start();
A sound plays, however it is not the sound file I specified, it is an unpleasant hissing / static sound.
I tested the application again, only changing the sound file. It played some of the sound but there was still a lot of white noise. This doesn't occur when opening the sound files normally in other applications.
I seem to be following the same steps as several textbooks / examples. Any idea where the problem may lie?
I need to encode the audio/video files that are placed in sdcard.
Then later on I have an User-Interface, where there is a media player where in I play these encoded files after decoding them.
Reason I need to encode these files is because, I dont want these files to be played by Android's default Media Player and want them to be played by my own App's Media Player.
Could you please suggest me some audio/video encoders and decoders supported by android.
Thank you