I'm trying to make a simple app that have various sounds and every sound (could be wav or mp3) have diferents volume controls but I donĀ“t know where start :S
I've been searching for the answer or similar answer but not exceed.
I will apreciate your help!
Initialize separate MediaPlayer objects. Use setVolume to control their volumes.
For more information:
http://developer.android.com/reference/android/media/MediaPlayer.html
Related
I use this code to set the maximum volume of the speaker.
AudioManager audioManager.setMode(AudioManager.MODE_IN_CALL);
audioManager.setStreamVolume(AudioManager.STREAM_MUSIC,audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC),0);
audioManager.setSpeakerphoneOn(false);
I would increase more this volume, but how can i do? I tried to use this:
audioManager.setStreamVolume(AudioManager.STREAM_MUSIC,2,0);
But nothing, the volume remain set to the same level.
An app as this: https://play.google.com/store/apps/details?id=com.mxtech.videoplayer.ad, for example, allow you to increase the volume to the 300%.
Any help?
Thank you.
What this app probably does is increase the volume of the file it is playing like for example the vlc player does when you increase the volume beyond 100%. It has nothing to do with the volume you set to the phone, it just compensates for files which have a more quiet audio track.
EDIT:
Of the top of my head I don't know of an easy solution, I imagine it would be very difficult to write such a functionality yourself. That's why I suggest you look for a library such as this:
https://code.google.com/p/musicg/
Or you can look at open source projects which implement this functionality or at least something similar such as this:
https://code.google.com/p/ringdroid/
But I fear even if you use musicg or find some bits of code in ringdroid which help you it's probably still not going to be easy.
Maybe anybody faced with this issue.
I use SoundPool for playing sounds in my app.
After playing the sound I need to do further action. But how can I determine that the sound has stoped?
All the sounds in the app have a different length, so I can not count the time. I need a different approach.
Thank you.
soundpool's purpose is to load and play simple small sounds without the need to monitor them.
what you probably need is MediaPlayer and setOnCompletionListener() :
http://developer.android.com/reference/android/media/MediaPlayer.html
http://developer.android.com/reference/android/media/MediaPlayer.html#setOnCompletionListener(android.media.MediaPlayer.OnCompletionListener)
I'm going to make an app related to sound modulation , where i need to record a sound and after recording the sound i need to play it in different modulation or sound effects like Reversing,Resampling,Pitchshifting,Robatization effect when I press the play button .Now I have the code to record a sound ,but don't know how to modulate the recorder sound as the above effects.
I search the whole web but did not find any solution.how do i implement this effects?
There are many apis which helps to accomplish this. For example-
Open SLES. AudioTrack.
Please have a look at this page.
I think it may help you.
I am looking for a way to play chords (4 notes together), threw audiotrack.
What is the best way to do this?
I consider about starting from a single sampled note, applying pitch filters to it. Is there a simpler solution for doing this?
thanks
A simpler way is to have an audio file for each note.
To play them at the same you will need to sum the signals of all the files. A java virtual machine is not the best environment to do this, take a look at the ByteBuffer API if you want to do it this way.
You can also use audiotrack objects in 4 different threads, so the write methode of AudioTrack won't block the other audiotracks playing sounds, I do this with 5 threads and it works.
how to fast forwarding an Audio file using media player in android on seekbar progress change?
I would use the 'seekTo()'-method and jump about 10 or 20 seconds each time.
I don't think MediaPlayer can do much more than play/pause actually. I'm using SoundPool non-stop, so someone should correct me if I'm wrong here.
I think you might need to add different versions of the song (with different speed) and change the actual source each time you want to speed up.