Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Integrating Java Opus wrapper in an android program.

 
tikhil jain
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I am kind of new to java , but not new to programming as such.. I am trying to integrate this wrapper for the opus codec into an android program: https://github.com/tbocek/opus-wrapper . But since I couldn't find any documentation, I couldn't really get started using it. ANy help please ? On just getting started with this ?

Thanks
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first thing to do is put the downloaded JAR in the /libs folder, write a simple program against it, then deploy it to Android to see if it will work. Not sure what Opus is, but not all Java APIs are available on Android so there is a chance it won't work. The easiest way to tell would be to try it.
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, and welcome to the Ranch!
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

A brief look indicates that this library relies on JNA - a library that is used to access native code from within Java code (sort of like JNI on steroids). Native code is very restricted in Android, so my gut feeling is that there will be problems ahead. At the least, you will need to build the native parts using the Android NDK, and then access it via JNI (as I don't think JNA will work on Android). At that point you're probably looking at a substantial rewrite of the wrapper code. (Mind you, that's just an educated guess, as I have no idea about either Opus or this wrapper.)
 
tikhil jain
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys. You all seem extremely helpful! So I'll ask another question. In short I am trying to compress a pcm wav audio clip to any compressed format. I have tried vorbis ogg and speex, both seem to work. But take A LOT of time to even compress a small 5 second clip. I am guessing its something wrong in my code.
Is there any java based wav/pcm to any compressed format library that can be used in android ?
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ogg and Speex are audio-specific formats, so what you're doing requires audio processing, which is comparatively more demanding than general compression. Two ideas that come to mind: a) upload the file to a server and process it there, b) use a more general compression scheme like zip or gzip (both of which are part of the Android API already).
 
tikhil jain
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Ulf : thanks. a) uncompressed wav files would be too large to upload , I think. (b) hmm compressing to zip, interesting idea, this would mean though in order to play the files they would needed to be uncompressed of course. I'll have to try this and see how fast it is. I'll get back to you with my results..
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you didn't say what you intended to do with the files, or where you would use them, so I could only guess :-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic