Effect Android Audio on wav file and save it

Demand

Android opens a WAV file on the SD card, plays it, adds some effect (for example, echo, pitch shift, etc.), saves the file with the effect. Simple: (

What i know

  • I can open and play the file using Soundpool or MediaPlayer.
  • I can give some effect during the game using both. those. for the media player I can set the effect of the surrounding reverb. Using SoundPool, I can set the playback speed, which is kind of like a pitch shift. I am successfully implementing them right now.
  • But any of these classes has no way to save the reproduced file. Therefore, I can only play, I can not save music using the effect.

What i want to know

  • Are there any other classes of interest besides MediaPlayer or Soundpool. Do not pay attention to salvation, just indicate the class, I will do research on saving the file with them.
  • Any third-party libraries where I can add effects and save? Happy if it is open source and free. But name them, even if it is a property.
  • Any other areas where I can peek. Does OpenAL voice support filtering and voice positioning? Will it work with Android?

Ready for the dirty job. Please lend me a way.

EDIT:

We did a few more searches and stumbled upon AudioTrack . But it will also not support file saving. So no luck there.

EDIT

OK, what if I do it myself? Get the raw bytes from the wav file and work on it. I wrote a wav file using AudioRecord, got a wav file. Is there any resource that describes low-level sound processing (I mean byte level).

EDIT

It’s good that the time of the battle is over, and I give generosity to the only answer that I have. After 7 days, I realized that
  • We cannot save what we play using MediaPlayer, AudioTrack, etc.
  • No sound processing libraries available.
  • You can receive raw wav files and process audio yourself. the answer gave a nice wrapper class for reading / writing wav files. good java code to read and change the tone of wav files here .
+8
android audio-processing android-mediaplayer soundpool audioeffect
source share
1 answer

The WavFile class http://www.labbookpages.co.uk/audio/javaWavFiles.html claims to read and write wav files and allow manipulation of each selection through arrays of sample values. This, of course, is quite small, with only 23 kbytes of total source code.

For some time I struggled to create an Android application with the Wavfile class enabled. This turned out to be because both the WavFile and ReadExample (from the link above) were intended as stand-alone java programs, so include the main(String [] args){} method. Eclipse sees this and believes that the class is a standalone executable program, and when I click the run button, it tries to execute only one class using java on the development machine, instead of launching the entire application on its phone. When I take care of launching the entire application with a small drop-down menu on the run button, I have no problems, and the WavFile class and examples immediately get in, give zero warnings in the IDE and work as advertised on my phone.

+5
source share

All Articles