Author Topic: BASS for Android  (Read 390177 times)

3delite

  • Posts: 895
Re: BASS for Android
« Reply #475 on: 26 Dec '13 - 22:21 »
Adding native Opus encoding to BASSEnc would be cool, if it's possible. ::)

_Tobias

  • Posts: 10
Re: BASS for Android
« Reply #476 on: 27 Dec '13 - 15:51 »
Adding native Opus encoding to BASSEnc would be cool, if it's possible. ::)
To clarify, I'm interested in decoding :)

3delite

  • Posts: 895
Re: BASS for Android
« Reply #477 on: 27 Dec '13 - 22:52 »
The .zip archive in the first post does include BASSOpus, maybe that's what you are looking for? :)

japostoles

  • Posts: 6
Re: BASS for Android
« Reply #478 on: 28 Dec '13 - 19:04 »
Is there a bassmix x86 build?

japostoles

  • Posts: 6
Re: BASS for Android
« Reply #479 on: 28 Dec '13 - 21:04 »
Since bassenc will not be ported for android, what's the best way to capture output from the mixer (that is being played over the speakers) and send data to a thread for output processing to disk, etc?

Ian @ un4seen

  • Administrator
  • Posts: 20393
Re: BASS for Android
« Reply #480 on: 31 Dec '13 - 16:06 »
Thanks, I've tried the BASS_MIDI_StreamGetMarks function with this midi file https://www.dropbox.com/s/u9ldcgmfl8uyiw5/brahms_jungeLieder.mid.

Unfortunately, the app crashes immediately without exception message when calling the function with BASS_MIDI_MARK_LYRIC (With BASS_MIDI_MARK_TEXT it's fine).

Ah yes, BASS_MIDI_StreamGetMarks's Java wrapper had a return value type problem (boolean instead of int) which meant that the return value was limited to 8 bits. In your test case, that meant it returned 16 instead of 272, resulting in your BASS_MIDI_MARK array being too small. A BASSMIDI update to fix that is up in the first post.

Is there a bassmix x86 build?

A BASSmix build has now been added to the x86 package in the first post.

Since bassenc will not be ported for android, what's the best way to capture output from the mixer (that is being played over the speakers) and send data to a thread for output processing to disk, etc?

You can set a DSP function on the mixer via BASS_ChannelSetDSP, and then write the data to disk in there (or buffer the data for a worker thread to write to disk if you prefer). If you have other DSP/FX set on the mixer and you would like them to be present in the written file, you should give the writer DSP a lower "priority" value than them.

recoilme

  • Posts: 11
Re: BASS for Android
« Reply #481 on: 6 Jan '14 - 07:55 »
Hi Ian.

Do you have any example how reads tags from file on android, without playing?
Do you plan to implement read album covers?

Thank you

recoilme

  • Posts: 11
Re: BASS for Android
« Reply #482 on: 6 Jan '14 - 13:05 »
Successfuly test tags read 4 android.
It work 3 times faster then similar java lib:http://www.jthink.net/jaudiotagger/
Near 20 ms per file on nexus 4
But don't find how read album art from id3 4example(
Psevdocode:
Code: [Select]
//i think you must load plugins for read flac tags or similar, but don't sure
if (BASS.BASS_Init(-1, 44100, 0)) {
                String nativePath = context.getApplicationInfo().nativeLibraryDir;
                String[] listPlugins=new File(nativePath).list();
                for (String s: listPlugins) {
                    int plug=BASS.BASS_PluginLoad(nativePath+"/"+s, 0);
                }
            }

//...
BASS.BASS_StreamFree(chan);
//not sure what must free previous chanel
                        chan = BASS.BASS_StreamCreateFile(path, 0, 0, 0);
                        String tags =""+TAGS.TAGS_Read(chan, "%UTF8(%ARTI)@%YEAR@%TRCK@%UTF8(%TITL)@%UTF8(%ALBM)@%COMP"+" ");
//this get artist@album stuff

Ian @ un4seen

  • Administrator
  • Posts: 20393
Re: BASS for Android
« Reply #483 on: 6 Jan '14 - 17:56 »
I'm afraid the TAGS add-on doesn't currently handle album art, so you would need to use another library to process that, eg. use BASS_ChannelGetTags (with BASS_TAG_ID3V2) to get the ID3v2 tag block and then pass that to an ID3v2 processing library.

mrnrone

  • Posts: 4
Re: BASS for Android
« Reply #484 on: 7 Jan '14 - 10:50 »
Hi,

please let me know how can I switch audio playback output between device's loudspeaker and earspeaker on Android? Is it possible anyway?
(As I read before the Android version based on OpenSLES and afaik is it possible)

Thx  :)

Ian @ un4seen

  • Administrator
  • Posts: 20393
Re: BASS for Android
« Reply #485 on: 7 Jan '14 - 13:23 »
I haven't tried it myself, but it appears to be possible to switch between the 2 speakers via the AudioManager.setSpeakerphoneOn function. Your app will also need to have the MODIFY_AUDIO_SETTINGS permission enabled.

   http://developer.android.com/reference/android/media/AudioManager.html

mrjoey

  • Posts: 31
Re: BASS for Android
« Reply #486 on: 8 Jan '14 - 07:12 »
Mr Ian i see there s in the dsp example 3 DSPPROC " flanger , echo and rotate"
please can u impliment a dspproc for audio limiter or AGc cz the example u gave about a preamp for the equalizer didnt work and only  controls the gain manuallly i d really appreciate if u wrote a dspproc for audio limiter tnx , best regards .

mrjoey

  • Posts: 31
Re: BASS for Android
« Reply #487 on: 8 Jan '14 - 09:04 »
Edit : i downloaded bass_fx 2.4.10 and i found
   Deprecated effects in 2.4.10 version:
      ------------------------------------
      BASS_FX_BFX_ECHO      -> use BASS_FX_BFX_ECHO4
      BASS_FX_BFX_ECHO2      -> use BASS_FX_BFX_ECHO4
      BASS_FX_BFX_ECHO3      -> use BASS_FX_BFX_ECHO4
      BASS_FX_BFX_REVERB      -> use BASS_FX_BFX_ECHO4 with fFeedback enabled
      BASS_FX_BFX_FLANGER      -> use BASS_FX_BFX_CHORUS
      BASS_FX_BFX_COMPRESSOR   -> use BASS_FX_BFX_COMPRESSOR2
      BASS_FX_BFX_APF         -> use BASS_FX_BFX_BQF with BASS_BFX_BQF_ALLPASS filter
      BASS_FX_BFX_LPF         -> use 2x BASS_FX_BFX_BQF with BASS_BFX_BQF_LOWPASS filter and appropriate fQ values
   */
are deprecated so i tried the undeprecated effects like compressor2 and distortion but 0 is returned,are they still deprecated is possible the next update theses effects will be enabled? i would really wish to use the compressor effect tnx

Ian @ un4seen

  • Administrator
  • Posts: 20393
Re: BASS for Android
« Reply #488 on: 8 Jan '14 - 16:25 »
i tried the undeprecated effects like compressor2 and distortion but 0 is returned

What is the error code from the BASS_ChannelSetFX call? If it is BASS_ERROR_ILLTYPE, then that will indicate that the BASS_FX library is not loaded. You can add a BASS_FX function call to force it to be loaded, eg. call BASS_FX_GetVersion in your initialization code.

mrjoey

  • Posts: 31
Re: BASS for Android
« Reply #489 on: 8 Jan '14 - 16:52 »
the bass_getversion return : 33819136
the bass_fxgetversion return : 33818880
the error code returned by BASS_ChannelSetFX(chan, BASS_FX_BFX_COMPRESSOR2,1) is : 0
and the error code from bass is : 5 wish mean BASS_ERROR_HANDLE
by the way BASS_FX_BFX_PEAKEQ is working.

Chris

  • Posts: 1808
Re: BASS for Android
« Reply #490 on: 8 Jan '14 - 17:10 »
Can you just show the Part Creating the Stream ..../creating the effect
BASS_ERROR_HANDLE will mean the stream is not valide

mrjoey

  • Posts: 31
Re: BASS for Android
« Reply #491 on: 8 Jan '14 - 17:20 »
BASS_StreamCreateFile(paths & "/" & fileList.get(y-1),0,0,0) and the initializing is
BASS_SetConfig(BASS_CONFIG_FLOATDSP,1)
BASS_SetConfig(BASS_CONFIG_BUFFER, 500)
BASS_Init(-1,44100,0)
Dim cm As Comp2

Dim jj As Int
jj = BassService.a.BASS_ChannelSetFX(chan, BassService.b.BASS_FX_BFX_COMPRESSOR2,1)
BassService.a.BASS_FXGetParameters(jj,BassService.cm)
BassService.cm.fAttack = 1
BassService.cm.fRelease= 1000
BassService.cm.lChannel = BassService.b.BASS_BFX_CHANALL
BassService.cm.fThreshold = -60
BassService.a.BASS_FXSetParameters(jj,BassService.cm)

other effects like BASS_FX_BFX_VOLUME , BASS_FX_BFX_PEAKEQ are working.
im using basic4android "bassService" is a service module ive created dont worry about it.

Ian @ un4seen

  • Administrator
  • Posts: 20393
Re: BASS for Android
« Reply #492 on: 8 Jan '14 - 17:35 »
Are you getting the BASS_ERROR_HANDLE error code (via BASS_ErrorGetCode) after the BASS_ChannelSetFX call or after the BASS_FXSetParameters call? If the latter, please check the former too. As Chris mentioned, BASS_ERROR_HANDLE from BASS_ChannelSetFX would indicate that "chan" is invalid. BASS_ERROR_HANDLE from BASS_FXSetParameters would indicate that "jj" is invalid, ie. the BASS_ChannelSetFX call failed.

If you have created your own wrapper for BASS and BASS_FX, also double check that you have defined BASS_FX_BFX_COMPRESSOR2/etc correctly.

mrjoey

  • Posts: 31
Re: BASS for Android
« Reply #493 on: 8 Jan '14 - 17:46 »
yes im getting the error code from BASS_ErrorGetCode
if "chan" is invalid why on peak_eq is working and on the compressor2 is not , can u give me an example for the right way to create a stream and add a compressor to it please tnx again.

Ian @ un4seen

  • Administrator
  • Posts: 20393
Re: BASS for Android
« Reply #494 on: 8 Jan '14 - 17:53 »
Where are you calling BASS_ErrorGetCode? I suspect it is after the BASS_FXSetParameters call? If so, call it after BASS_ChannelSetFX too and see what error code you get then.

mrjoey

  • Posts: 31
Re: BASS for Android
« Reply #495 on: 8 Jan '14 - 17:57 »
yes ur right the error code is 19 wish means BASS_ERROR_ILLTYPE  i called bass_geterror after BASS_ChannelSetFX
so u mean bass_fxlib.so is not loaded?or what? cz im sure bass_fxlib.so is loaded cz peakeq is working

Chris

  • Posts: 1808
Re: BASS for Android
« Reply #496 on: 8 Jan '14 - 19:32 »
the bass_Fx_GetVersion return : 33818880

Are you shure you will have the latest bass_fx lib?
33818880 will return to hex 2040900(2.4.9)
So you will not have the latest Bass_FX lib !
The Effect .BASS_FX_BFX_COMPRESSOR2 was build/available in Bass_FX as the Version 2.4.10 !!
The latest BASS_FX version is 2.4.10.1
« Last Edit: 8 Jan '14 - 19:39 by Chris »

mrjoey

  • Posts: 31
Re: BASS for Android
« Reply #497 on: 9 Jan '14 - 10:56 »
i tried and tried but failed i downloaded bass fx from (: JOBnik! :) forum and downloaded it also from this forum on the first post and both give me the same version number i tried to wrappe them using android.jar 17 and 19 and also JRE 17 and 19 but failed , eq is working and compressor2 is not , and i called bassfx get version after init and same problem appears , im out of ideas , im gona try the examples maybe BPM example and im gona call bassfx getversion and see what will get.

mrjoey

  • Posts: 31
Re: BASS for Android
« Reply #498 on: 9 Jan '14 - 11:35 »
i got 33819137 from the eclipse example BPM , so i think its the wrapper problem right? i will fix it , anyway thank u Mr Ian and thank u Mr Chris for ur time and help appreciated any new i will update , best regards  :)

mrjoey

  • Posts: 31
Re: BASS for Android
« Reply #499 on: 9 Jan '14 - 15:17 »
[solved] it was load library issue tnx :)