6

I am trying to apply new audio pitch for my video file.

I want to replace audio of my existing video by android code. Is it possible in android. can any one help me to do this

Is there any Android library support this facility to change audio for video file?

Any Help is appreciated...!!! Thanks in Advance

Hitesh Patel
  • 2,868
  • 2
  • 33
  • 62
  • 2
    Splitting and re-merging audio tracks can be tricky even on a desktop machine - every different video container format has different complications (and sometimes patents, making open-source solutions more difficult). You may have more luck if you focus your question on a single format. – ProjectJourneyman Sep 08 '12 at 04:45
  • hi hitesh,did you get the answer for this? – rams Dec 14 '12 at 09:16
  • Hello Hitesh, did you get the answer ? I want to do something similar to this. If you got the answer please post the code. – Mayur May 19 '14 at 06:56

2 Answers2

2

This is not the exact solution but you can try it:

  1. When you play the video file set its volume to zero.

  2. At the same time use the service in which you can play any audio you want.

  3. As service runs at background it has no effect on your video streaming.

  4. When your video end,end your service.

And remember to set volume of your audio file.

Shadow The GPT Wizard
  • 66,030
  • 26
  • 140
  • 208
dd619
  • 5,910
  • 8
  • 35
  • 60
  • @Shadow Wizard is it possible to apply audio effect on a video file? like this app [Example App Link](https://play.google.com/store/apps/details?id=com.mobile.bizo.videovoicechanger&hl=en) – Hamza Hafeez Jul 18 '16 at 05:15
  • @HamzaHafeez sorry, no idea. I just approved a pending edit to fix the formatting of the answer, I'm not familiar with the contents. – Shadow The GPT Wizard Jul 18 '16 at 05:58
  • Its ok... @dd619 is it possible to apply audio effect on a video file? like this app [Example App Link] (https://play.google.com/store/apps/details?id=com.mobile.bizo.videovoicechanger&hl=en) – Hamza Hafeez Jul 18 '16 at 06:33
  • Android have API for this, please refer https://developer.android.com/reference/android/media/SoundPool.Builder.html – dd619 Jul 18 '16 at 06:54
0

You can change video pitch easily by following these steps :-

  1. Add this library in your android project : https://gitlab.com/soundtouch/soundtouch. follow this link for integrate this library process : https://stackoverflow.com/a/52425255/7899427.

  2. After successfully integrate this library first of all extract audio file in WAV audio format. You can use ffmpeg library for do this.

  3. Than using the soundtouch library you can change the audio file pitch and tempo rate and export new audio file in WAV format.

  4. After complete these steps merge that converted audio file with video file.

Now will get the converted audio file with same video file. Happy coding.