Reputation: 5023
Update:
Question in Short:
How to do Audio *Time Stretching* and Pitch shifting in Android?
How to slow mo the video?
Question in detail:
What am I trying to do?
I am trying to do ramp slow mo in a video file along with the audio and have to save the processed videos.
What is ramp slow mo or what i want to do ?
http://www.youtube.com/watch?v=BJ3_xMGzauk
The slow mo effect has to be taken place in the form of English letter "U".
Normal Slow Mo : " |__| "(Linear - like slowing down the video to 2x or 4x)
Ramp Slow Mo : " U " (Parabolic)
I have already done this app for IOS devices successfully.
How i achieved ramp slow mo for IOS?
Separated audio and video.
For video,I did dynamic time stretching to achieve parabolic effect.
for(i=0;i=around 10 intervals;i++)
{
do time stretching
}
For Audio, along with time stretch, i also did pitch shifting as in the you tube link.
for(i=0;i=around 10 intervals;i++)
{
do time stretching
do Pitch shifting
}
Questions:
How to do this effect in Andorid? Are there default API's available in Android SDK to do ramp slow mo(Audio/Video Time Stretching + Audio Pitch shifting)?
As part of third party packages,for IOS, i used Dirac to do Audio Time Stretching and Pitch shifting. But unfortunately DIRAC is not available for android platforms.
Upvotes: 3
Views: 1226
Reputation: 372
I cannot speak about the best solution for video (short of implementing your own custom view with the special requirements you've provided), but I have some input on audio playback. Android supports a sample playback class that allows playback rate control:
http://developer.android.com/reference/android/media/SoundPool.html
It's one thing to change the sample playback rate; you wanted to perform what sounds like independent time stretch and pitch shift. This is the domain of an FFT based class of algorithms called Phase Vocoders. With respect to audio, I would start by looking at libraries in Java for such effects. If you want to roll your own, this answer should get you off to a good start:
Android: How to shift pitch of output sound (realtime)
Upvotes: 1