Author Topic: BASS for Android  (Read 392246 times)

Ian @ un4seen

  • Administrator
  • Posts: 20437
Re: BASS for Android
« Reply #1325 on: 19 Oct '17 - 16:11 »
A BASS update that adds support for using AudioTrack output (instead of OpenSL ES) is up now in the 1st post. See the post for details.

otherside

  • Posts: 24
Re: BASS for Android
« Reply #1326 on: 22 Oct '17 - 10:47 »

Ian @ un4seen

  • Administrator
  • Posts: 20437
Re: BASS for Android
« Reply #1327 on: 7 Nov '17 - 14:52 »
The Android version of the new BASSenc_FLAC add-on is now up in the 1st post.

dieppa

  • Posts: 2
Re: BASS for Android
« Reply #1328 on: 28 Nov '17 - 11:04 »
Hi. I am trying to play songs but it always returns 0 to the channel. Can someone tell me what am I doing wrong? Thanks!

int channel =222;
BASS.BASS_MusicFree(channel);
                BASS.BASS_StreamFree(channel);


                channel = BASS.BASS_StreamCreateFile(choosedSong, 0, 0, BASS.BASS_SAMPLE_LOOP);
                channel = BASS.BASS_MusicLoad(choosedSong, 0, 0, BASS.BASS_SAMPLE_LOOP | BASS.BASS_MUSIC_RAMP, 1);
                BASS.BASS_ChannelPlay(channel, false);

Edit:

I forgot to initialize the device  8) 8) 8) 8)
« Last Edit: 28 Nov '17 - 12:02 by dieppa »

dieppa

  • Posts: 2
Re: BASS for Android
« Reply #1329 on: 29 Nov '17 - 09:52 »
Hello, is there a way to set Bass boost and gain levels using FX? Thanks in advance.

Ian @ un4seen

  • Administrator
  • Posts: 20437
Re: BASS for Android
« Reply #1330 on: 30 Nov '17 - 14:02 »
You can use the BASS_FX_DX8_PARAMEQ effect via BASS_ChannelSetFX to apply a bass boost. For example, something like this:

Code: [Select]
int bboostfx = BASS.BASS_ChannelSetFX(channel, BASS.BASS_FX_DX8_PARAMEQ, 0); // set an EQ effect on a BASS channel
BASS.BASS_DX8_PARAMEQ param = new BASS.BASS_DX8_PARAMEQ();
param.fCenter = 100;
param.fBandwidth = 12;
param.fGain = 6;
BASS.BASS_FXSetParamters(bboostfx, param); // apply the parameters

You can play around with the parameters to find something that you like.

The BASS_ATTRIB_VOL option can be used (via BASS_ChannelSetAttribute) to control overall level, but it currently doesn't allow amplification with standard playback (it does with a mixer). For that, you can use the BASS_FX add-on's BASS_FX_BFX_VOLUME effect, again via BASS_ChannelSetFX. For example:

Code: [Select]
int volfx = BASS.BASS_ChannelSetFX(channel, BASS_FX.BASS_FX_BFX_VOLUME, 0);
BASS_FX.BASS_BFX_VOLUME param = new BASS_FX.BASS_BFX_VOLUME();
param.lChannel = 0;
param.fVolume = Math.pow(10.0, gaindb / 20.0);
BASS.BASS_FXSetParameters(volfx, param);

Note that the BASS_FX library needs to loaded before you can use its effects. You can force it to be loaded by calling a function from it, eg. BASS_FX_GetVersion during initialization.