Developing 3D Audio Library For Android


Last Updated:

  1. paulscode

    paulscode Well-Known Member This Topic's Starter

    Joined:
    Mar 18, 2010
    Messages:
    86
    Likes Received:
    14
    Hello, all. I am new to Android development, and I am planning to write a 3D audio library for use in 3D projects/games when stereo is available (headsets, external speakers). I have a lot of experience with Java (I've written a 3D audio library that is being widely used by Java developers), but I currently have zero experience developing for Android (I actually just finished installing the SDK).

    I am looking for source code[​IMG], tips, links to related topics, etc related to the following:

    1) URL-like reading of bytes from files.
    2) Playback of raw PCM audio data.
    3) Setting audio format[​IMG] (sample rate, frame size, frame rate, etc)
    4) Playing sound from multiple "channels" simultaneously (audio mixing)
    5) Controlling playback pan and gain of these "channels"

    I know these topics are rather broad in scope, but my main purpose for this post is to get the conversation started and get some ideas. As I start playing around with example code and getting my feet wet, I'll be able to ask more specific questions.
     

    Advertisement
  2. paulscode

    paulscode Well-Known Member This Topic's Starter

    Joined:
    Mar 18, 2010
    Messages:
    86
    Likes Received:
    14
    I found a class that seems to have all the capabilities I need to create a 3D sound library for Android. It is called AudioTrack. The "write" method can be used to play PCM audio data, and the "setStereoVolume" method can be used to take care of gain and pan. It'll just take a little trigonometry - I've already done something similar with with JavaSound, so that part shouldn't bee too difficult. I will need to run some tests to see how well Android is able to mix multiple playing AudioTrack instances. If it can handle a reasonable number, then I should be good to go.
     

Share This Page

Loading...