3

I have been developing a music editing Android app. I have written a considerable amount of code so far. However, due to audio latency issues encountered on the Android platform, I now realize that it is necessary to optimize my code using C/C++ (Android NDK) in order to manipulate audio files (Wav & MP3), and thus, hopefully, boost the app performance. Unfortunately, I wasn't able to find concise resources dealing with the topic.

Could anybody post code examples on how to decode wav/mp3 files and mix them using C++? Any resource would be greatly appreciated.

Jonas
  • 121,568
  • 97
  • 310
  • 388
Ziki Kongawi
  • 687
  • 1
  • 7
  • 9
  • Usually file-reading does not cause latency issues; rather processing does. what are you trying to accomplish, exactly? – Bjorn Roche Jul 17 '12 at 19:29
  • I would like to mix audio files using c++. – Ziki Kongawi Jul 17 '12 at 21:08
  • If you are having latency issues simply mixing two files you probably have a design/architecture issue. Switching to C++ might help, but if you have the same design, it might not. – Bjorn Roche Jul 18 '12 at 01:10

1 Answers1

3

Here is a simple example for loading a wave file using C/C++. It will help you get the ideas :)

As far as playing it .. you would probably be best off using OpenSLES which is supported under the NDK on android.

Goz
  • 61,365
  • 24
  • 124
  • 204