Author Topic: BASS for Android  (Read 390554 times)

Ian @ un4seen

  • Administrator
  • Posts: 20401
Re: BASS for Android
« Reply #225 on: 5 Oct '12 - 14:07 »
Thanks for delivering bass audio to android  :) I'm very surprised about the fact that the samples is using gapless audio playback. I'm talking about how the song loops without any pause which happens on android Mediaplayer's setLoop .How did you manage to do that? I've tried google's native audio samples and theres gaps in it also. I would be much appreciated if you could clarify it . thanks!

I'm not familiar with how Android's "MediaPlayer" stuff works, so I can't comment on that, but BASS achieves gapless looping by having the decoder continue from the start as soon as the end is reached. Nothing too clever :)

Quote
chan=BASS_AAC.BASS_MP4_StreamCreateFile(file, 0, 0, BASS.BASS_SAMPLE_LOOP))

note that it works fine in other devices, but not in htc one s with android 4.0.3.

the problem seems to be that the enconding of this device is different than de other.

The problem was due to the MP4 file using "co64" atoms (rather than the usual "stco"), which BASS_AAC didn't support. An update with support for that is now up in the 1st post. Let me know if you still have the problem with it.

frandroid

  • Posts: 8
Re: BASS for Android
« Reply #226 on: 5 Oct '12 - 15:47 »
nice job Ian

now works fine
thanks a lot!!!  :)

frandroid

toob

  • Posts: 133
BASS for Android - Record from Mic to file
« Reply #227 on: 6 Oct '12 - 09:24 »
Hi,

Is there a method I could utilise to record from  android device microphone and create a file in any format, ie .wav? I started along the route of using BASSenc until I noticed this isnt supported in the Android version.

Thanks
Mark

Ian @ un4seen

  • Administrator
  • Posts: 20401
Re: BASS for Android
« Reply #228 on: 8 Oct '12 - 15:42 »
To write a WAV file, you would need to generate a WAV header and place it in front of the sample data. You can find an example of doing that in the RECTEST example. Note the RECTEST example records to memory and then gives the option of writing the end result to a file (I have just added a "Save" option to it), to match what the RECTEST example does on other platforms. You may prefer to record directly to file, in which case you can modify the RECORDPROC function to do so.

Cuarento

  • Posts: 3
Re: BASS for Android
« Reply #229 on: 15 Oct '12 - 15:07 »
Hi,

i have a Problem with "BASS_StreamCreateURL(..)" playing a Internetstream
(http://dsl.tb-stream.net:80).
When i try to connect via WIFI on my Smartphone, then "BASS_StreamCreateURL(..)" creates the stream successfully, but when i try to connect over the 3G mobile network it always gives me the Errorcode 41 (BASS_ERROR_FILEFORM).
I tried this with the NetRadio-Example and there happens the same.

What could be the Problem?

Thank´s for your help

Markus

Ian @ un4seen

  • Administrator
  • Posts: 20401
Re: BASS for Android
« Reply #230 on: 15 Oct '12 - 16:18 »
When you try to play the stream over the 3G connection in the NETRADIO example, do you see any HTTP or ICY status message/code displayed? Also, are you able to play the stream over the 3G connection with any other players? Does the problem only happen with particular URL(s) and not others?

Cuarento

  • Posts: 3
Re: BASS for Android
« Reply #231 on: 15 Oct '12 - 17:28 »
No, i get only error code 41.
I tried it with the tuneIn App and it doesn't seem to work too.
It happens only for the URLs form this radiostation.

Ian @ un4seen

  • Administrator
  • Posts: 20401
Re: BASS for Android
« Reply #232 on: 15 Oct '12 - 18:03 »
Strange that it only happens with that station; perhaps they've blacklisted your 3G ISP? The HTTP/ICY status should give a clue. The NETRADIO example does seem to have a problem displaying that, so I have put up an updated version of it (in the package in the 1st post) to hopefully fix that. Please try again, and see if you now get the HTTP/ICY status displayed.

yolanda

  • Posts: 1
Re: BASS for Android
« Reply #233 on: 16 Oct '12 - 10:03 »
How can i direct the original data to file?
While playing an icy stream, i want to save meta-stripped data to audio file with an extension .m4a or .mp3 according to the content type. So i can play it with native MediaPlayer of Android or with BASS (again) by just giving the recordings local filename.
« Last Edit: 16 Oct '12 - 12:41 by yolanda »

Ian @ un4seen

  • Administrator
  • Posts: 20401
Re: BASS for Android
« Reply #234 on: 16 Oct '12 - 14:53 »
You can save the downloaded data to file by implementing a DOWNLOADPROC callback function that does that, and then provide that in your BASS_StreamCreateURL call. To detect the content type, you could check the stream's "ctype" value using BASS_ChannelGetInfo.

choobdar

  • Posts: 2
Re: BASS for Android
« Reply #235 on: 23 Oct '12 - 08:33 »
Hi every body
i just downloaded this library and i cant use it.
when im trying to call any method of BASS.java (for example BASS_GetVersion() ) i get this logcat error

Code: [Select]
10-23 10:58:21.337: E/AndroidRuntime(932): java.lang.UnsatisfiedLinkError: BASS_GetVersion

i attached the image of my logcat.

please help me. i really need this library.

Ian @ un4seen

  • Administrator
  • Posts: 20401
Re: BASS for Android
« Reply #236 on: 23 Oct '12 - 17:07 »
That's strange. From your log, the BASS library (libbass.so) was loaded, so I'm not sure why the functions apparently can't be found. Does the problem happen with the examples too? What device and Android version are you using?

choobdar

  • Posts: 2
Re: BASS for Android
« Reply #237 on: 27 Oct '12 - 09:15 »
That's strange. From your log, the BASS library (libbass.so) was loaded, so I'm not sure why the functions apparently can't be found. Does the problem happen with the examples too? What device and Android version are you using?

yes , the problem happens with the examples. my device is galaxy S2 with android 2.3.3

Ian @ un4seen

  • Administrator
  • Posts: 20401
Re: BASS for Android
« Reply #238 on: 29 Oct '12 - 13:02 »
OK. To investigate further, please upload the Eclipse project (including entire folder structure) that you're using to build one of the BASS examples here...

   ftp.un4seen.com/incoming/

frandroid

  • Posts: 8
Re: BASS for Android
« Reply #239 on: 30 Oct '12 - 08:01 »
Hi

Has anyone tested the library on Google TV?. I'm trying to implement in my app, but it don't works. With the example app occurs  the same error:

Code: [Select]
UnsatisfiedLinkError: Couldn't load bass: find library returned null
The android version on google tv is 3.2

Ian @ un4seen

  • Administrator
  • Posts: 20401
Re: BASS for Android
« Reply #240 on: 30 Oct '12 - 16:39 »
What CPU does your Google TV device have? It looks like it is available in both x86 and ARM versions. The main Android BASS package currently only includes support for ARM, but in case your device uses x86, here's an x86 library version to try...

   www.un4seen.com/stuff/bass-android-x86.zip

Copy the "x86" folder into your project's "libs" folder.

frandroid

  • Posts: 8
Re: BASS for Android
« Reply #241 on: 31 Oct '12 - 09:20 »
Hi Ian

I have tested the library but it didn't works. The google tv I'm using is this
http://www.logitech.com/en-us/support/smart-tv/logitechrevue?osid=14&bit=32

The android version is 3.2 and the processor information is this

Code: [Select]
C:\android-sdk\platform-tools>adb shell cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 28
model name      : Intel(R) Atom(TM) CPU CE4150   @ 1.20GHz
stepping        : 10
cpu MHz         : 1200.052
cache size      : 512 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat clflush dts acpi mmx fxsr sse sse2 ss tm pbe nx lm constant_tsc up arch_perf
mon pebs bts aperfmperf pni dtes64 monitor ds_cpl tm2 ssse3 cx16 xtpr pdcm movbe
 lahf_lm
bogomips        : 2400.10
clflush size    : 64
cache_alignment : 64
address sizes   : 32 bits physical, 48 bits virtual
power management:

thanks for your help

Ian @ un4seen

  • Administrator
  • Posts: 20401
Re: BASS for Android
« Reply #242 on: 31 Oct '12 - 13:55 »
That is an x86 CPU, so you would need the BASS library version that I posted above. After placing the "x86" folder in your "libs" folder, did you also "Refresh" the "libs" folder in Eclipse? To confirm whether the x86 library version is being included in your app, you can look inside the APK package (in the "bin" folder) using a ZIP archiver (APK files are ZIP archives).

frandroid

  • Posts: 8
Re: BASS for Android
« Reply #243 on: 31 Oct '12 - 16:04 »
Hi

I did what you say. The x86 library is inside "libs" folder inside APK, as ARM librarys. There is not any bin folder. The same error continues when I initialize BASS.

I have read something as the NDK doesn't support google tv. Could this be the problem?

http://forum.gtvhacker.com/revue-development/topic293.html

thanks

Ian @ un4seen

  • Administrator
  • Posts: 20401
Re: BASS for Android
« Reply #244 on: 31 Oct '12 - 18:00 »
I haven't tested with any Google TV devices myself, but from reading around, it does look like stuff built with the standard Android NDK (like BASS) won't work with Google TV, but it may be supported in a future NDK version.

   http://code.google.com/p/googletv-issues/issues/detail?id=12#c23

frandroid

  • Posts: 8
Re: BASS for Android
« Reply #245 on: 2 Nov '12 - 09:25 »
then we will have to wait  :'( :'(

thanks for your help again

trebun

  • Posts: 6
Re: BASS for Android
« Reply #246 on: 12 Nov '12 - 20:44 »
Hi there,

mkay, maybe I'm to stupid to create the example project, but I need your help.

Libs and so on - no problem, but...

Every BASS.[example: BASS.RECORDPROC] is marked as an error in the RecTest.java.

How can I fix it? I know, it is simple...but....

Regards,
trebun

Ian @ un4seen

  • Administrator
  • Posts: 20401
Re: BASS for Android
« Reply #247 on: 13 Nov '12 - 17:49 »
That sounds like the BASS.java file is missing from the project (or the path to it is incorrect). To add it to your project, you can use the "Build Path > Link Source" option to import the root "src" folder from the BASS package.

trebun

  • Posts: 6
Re: BASS for Android
« Reply #248 on: 14 Nov '12 - 08:56 »
Ian, you are so right and SHAME ON ME!  ::)

Thank you very much!

Regards,
trebun

MistaGreen

  • Guest
Re: BASS for Android
« Reply #249 on: 22 Nov '12 - 13:27 »
Is it possible to play WMA using BASS library? Or may be you know some other library to decode wma?