0

I'm trying to get a small aac radio stream to play in an android application. I'm trying to use http://code.google.com/p/aacdecoder-android/ but I have never had too much luck with code.google.com because I find a lot of the projects hard to use.

I downloaded the zip and I think I set it up correctly in my project properties.

When I try to run the line of code to play the file I get this error:

11-15 16:28:25.750: E/AndroidRuntime(3626): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load aacdecoder: findLibrary returned null

The code I use is this:

import com.spoledge.aacdecoder.AACPlayer;
...
AACPlayer aacPlayer = new AACPlayer();
aacPlayer.playAsync( "http://..." );

Any ideas? I don't think it's with aacdecoder project itself, I think that I'm actually setting it up incorrectly. I don't get any red lines in eclipse. Ideas?

enter image description here

EGHDK
  • 17,818
  • 45
  • 129
  • 204

3 Answers3

2

It seems that you forget to copy *.so (native libraries), because I've just created new project, added *.jar to Java Build Path (you've already done that) and it played stream fine. My code:

@Override
protected void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(new Button(this));

    AACPlayer aacPlayer = new AACPlayer();
    aacPlayer.playAsync( "http://http.yourmuze.com:8000/play/paradise/h.aac" );
}

And don't forget to add permission:

<uses-permission android:name="android.permission.INTERNET"/>
ArtemStorozhuk
  • 8,715
  • 4
  • 35
  • 53
  • I forgot the permission (thanks) but what do you mean `*.so`. I'm not sure what that means. – EGHDK Nov 15 '12 at 22:08
  • Native (c++) library (`so` is just an library extension). Read this - http://developer.android.com/tools/sdk/ndk/index.html. The library consist of two parts: 1) native (`.so`) is c++ port to android 2) java (`.jar` library) is just a wrapper of native library. So your application can't find first library - add it! It is in folder `libs/armaebi`. – ArtemStorozhuk Nov 15 '12 at 22:12
  • Do I add the `.so` to the /libs? – EGHDK Nov 15 '12 at 22:17
  • Just copy all contents from zipped folder `aacdecoder-android-libs-0.6.1` to your project's `libs` folder. – ArtemStorozhuk Nov 15 '12 at 22:19
  • Hrm... seems to work, but really "laggy". Another question is what the difference between "armeabi" and "armeabi-v7a" – EGHDK Nov 15 '12 at 22:31
  • Google it, my friend https://www.google.com.ua/search?q=difference+between+armeabi+and+armeabi-v7a&aq=0&oq=armeabi%22+and+%22armeabi-v7a&aqs=chrome.1.57j0j62l3.1832&sugexp=chrome,mod=13&sourceid=chrome&ie=UTF-8 – ArtemStorozhuk Nov 15 '12 at 22:32
0

Try looking at these links, they have similar problems

Community
  • 1
  • 1
jcw
  • 5,132
  • 7
  • 45
  • 54
-1

Make sure it's in the /lib folder and in the project properties in the build path. And make sure in the order its listed a higher than /src.

Gabe Sechan
  • 90,003
  • 9
  • 87
  • 127