Author Topic: BASS for Android  (Read 390056 times)

elimmedia

  • Posts: 11
Re: BASS for Android
« Reply #200 on: 23 Jul '12 - 04:10 »
I've uploaded sample midi files and soundfont.

The soundfont that I attached has only two preset (piano-1, horn-60)

Im not sure that piano has problem, but horn has.

Please let me know if you need any other samples, files.

Cheers,

I have tested the new update and it has the same problem.

I also tried passing filename directly and has same problem too.

I moved back to old library just in case, and it sounds fine.

OK. That looks like it is a more general problem then, not related to loading from memory. There were some internal tweaks recently (more floating-point calculations changed to fixed-point), so the problem is probably somewhere in that stuff. To locate the problem, please upload your soundfont and a MIDI file to reproduce it with here...

   ftp.un4seen.com/incoming/

fulbert

  • Posts: 6
Re: BASS for Android
« Reply #201 on: 23 Jul '12 - 05:34 »
Does BASS_aac for Android support PS (Parametric Stereo) in AAC+?

Ian @ un4seen

  • Administrator
  • Posts: 20389
Re: BASS for Android
« Reply #202 on: 23 Jul '12 - 17:02 »
I've uploaded sample midi files and soundfont.

The soundfont that I attached has only two preset (piano-1, horn-60)

Thanks for the test files. The problem was due to the horn's "To Filter Cutoff" setting being outside the valid range (+/-12000 cents), which was resulting in an overflow in a fixed-point calculation. An update that clamps that setting to the valid range is now up in the first post. Let me know if you still have any problems with it.

Does BASS_aac for Android support PS (Parametric Stereo) in AAC+?

I believe it does.

jonathan

  • Posts: 9
Re: BASS for Android
« Reply #203 on: 24 Jul '12 - 22:33 »
Hello,

I'm trying to build a simple test using the recording functionality.  I just want to take what is input via the mic and simply play it back over the speakers.

The problem I'm running into is early in the process attempting to setup the record input.  I call init successfully for both the library and the record init, but when I call BASS_RecordStart(44100, 1, 0, null, 0) I get BASS_ERROR_FORMAT (code: 6).  Any ideas what could be causing this?  It's very similar to the example, only not using a record proc.

Any help would be appreciated.  Thanks!

jonathan

  • Posts: 9
Re: BASS for Android
« Reply #204 on: 24 Jul '12 - 23:09 »
Ack.. figured it out.  I forgot the manifest permission... my mistake!

jonathan

  • Posts: 9
Re: BASS for Android
« Reply #205 on: 25 Jul '12 - 00:55 »
I was able to microphone playthrough to work correctly, but I'm curious if there are optimal settings for the lowest latency?  I understand Android is bad with latency at this time (hopefully Jelly Bean really DOES fix this!), but I'd like to get it as low as possible.

Currently I'm:

1. Initializing BASS
2. Initializing Recording
3. Create output PUSH stream
4. Create record stream via RecordStart with a RecordProc + RECORD_PAUSE
5. Play output stream
6. Play record stream

Is this the lowest latency?  I tried setting NOBUFFER on the output channel but that cause silence.. NOBUFFER on the record channel worked, but didn't appear to have any affect on latency.

Any ideas?

Ian @ un4seen

  • Administrator
  • Posts: 20389
Re: BASS for Android
« Reply #206 on: 25 Jul '12 - 14:43 »
I think not using a RECORDPROC function, and requesting data from the recording via BASS_ChannelGetData in a STREAMPROC function with BASS_ATTRIB_NOBUFFER enabled, would give the lowest latency. Something like this...

Code: [Select]
record=BASS.BASS_RecordStart(freq, chans, 0, null, null); // start recording without a RECORDPROC
output=BASS.BASS_StreamCreate(freq, chans, 0, StreamProc, null); // create a stream to play the recorded data
BASS.BASS_ChannelSetAttribute(output, BASS.BASS_ATTRIB_NOBUFFER, 1); // enable "no buffering" option
BASS.BASS_ChannelPlay(output, 0); // start the output

...

BASS.STREAMPROC StreamProc=new BASS.STREAMPROC() {
public int STREAMPROC(int handle, ByteBuffer buffer, int length, Object user) {
    int r=BASS_ChannelGetData(record, buffer, length); // get data from the recording
    return r;
}
};

You could also try lowering the BASS_CONFIG_DEV_BUFFER setting (prior to calling BASS_Init), eg. to 20ms (the default is 30ms)

elimmedia

  • Posts: 11
Re: BASS for Android
« Reply #207 on: 29 Jul '12 - 02:58 »
I've checked that it works fine now.

Please let us know when sample code for  BASS add-on is ready.

Thank you always.

I've uploaded sample midi files and soundfont.

The soundfont that I attached has only two preset (piano-1, horn-60)

Thanks for the test files. The problem was due to the horn's "To Filter Cutoff" setting being outside the valid range (+/-12000 cents), which was resulting in an overflow in a fixed-point calculation. An update that clamps that setting to the valid range is now up in the first post. Let me know if you still have any problems with it.

Does BASS_aac for Android support PS (Parametric Stereo) in AAC+?

I believe it does.

Ian @ un4seen

  • Administrator
  • Posts: 20389
Re: BASS for Android
« Reply #208 on: 30 Jul '12 - 16:59 »
Please let us know when sample code for  BASS add-on is ready.

I'll send it over today.

jeffdavis

  • Posts: 297
Re: BASS for Android
« Reply #209 on: 31 Jul '12 - 17:48 »
I want to use Basic 4 Android to develop an audio enhancement demo for Android tablets.   We use BASS for our Windows based demos.   I'm pretty sure the libraries will work with B4A  but was wondering if anyone has used Basic 4 Android with BASS and if anyone has done Audio DSP with BASS on Android?

jeffdavis

  • Posts: 297
Re: BASS for Android
« Reply #210 on: 9 Aug '12 - 23:54 »
Lets start with some basics.  I doesn't appear this is an existing sample application in the zip for BASS for Android?  It would be nice to have a simple tutorial on how to get starting using the BASS libraries in an Android application.   For example which flavor of Eclipse should we use?   What type of app should we create?   In my case I'd like to create a BASS library that could be used within an Android application for playing MP3 files.   What are all the files in the zip for?  For example what is the difference between the libs, src, and plugins folders?


Ian @ un4seen

  • Administrator
  • Posts: 20389
Re: BASS for Android
« Reply #211 on: 10 Aug '12 - 16:12 »
The "libs" folder contains the BASS library, the "src" folder contains the BASS Java class, and the "plugins" folder contains an Android version of the PLUGINS example. Android versions of the FXTEST/NETRADIO/RECTEST/MIDITEST examples are also included in the package. Please see the first post for some instructions on creating Eclipse projects for the examples. If you don't already have it, you will also need to get the Android SDK from here:

   http://developer.android.com/sdk/

Cuarento

  • Posts: 3
Re: BASS for Android
« Reply #212 on: 10 Aug '12 - 21:03 »
Hey,

I have a problem with "BASS_StreamPutData(..)", see the Code below:

Code: [Select]
byte[] buf1Bytes = {0, 1,3,4,5};
ByteBuffer testBuffer = ByteBuffer.wrap( buf1Bytes );
   
int length = BASS.BASS_StreamPutData( _streamID, testBuffer, testBuffer.capacity() );
   
int errorCode = BASS.BASS_ErrorGetCode();
       
// errorCode  = BASS_ERROR_ILLPARAM = 20; // an illegal parameter was specified

I always get the Error Invalid Param?

What iīm doing wrong?

Thanks for your effort
       

Ian @ un4seen

  • Administrator
  • Posts: 20389
Re: BASS for Android
« Reply #213 on: 13 Aug '12 - 14:15 »
BASS_ERROR_ILLPARAM indicates that the "length" parameter ("testBuffer.capacity()" in this case) is invalid. Please confirm how you created the stream, ie. what were the BASS_StreamCreate call parameters? The stream would need to be mono 8-bit (or 5 channel 8-bit) for your example byte array to be valid, as 5 bytes of data won't be a whole number of samples in any other format.

Ian @ un4seen

  • Administrator
  • Posts: 20389
Re: BASS for Android
« Reply #214 on: 17 Aug '12 - 18:01 »
An Android version of the new BASSOPUS add-on is now included in the package in the 1st post.

Brannon

  • Posts: 16
Re: BASS for Android
« Reply #215 on: 31 Aug '12 - 23:42 »
It appears that the decoders are exposed in API 16 (Jelly Bean). See here:

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

Can BASS for Android be changed to use that API? And if so, does that imply that there are no MP3 patent concerns?

Ian @ un4seen

  • Administrator
  • Posts: 20389
Re: BASS for Android
« Reply #216 on: 3 Sep '12 - 17:26 »
I don't think BASS can use that particular API, as it is Java rather than native, but some native decoding support was also added in Android 4.0 (API 14). It doesn't look totally perfect, eg. user file streaming (BASS_StreamCreateFileUser) doesn't look possible, but it could be useful for local file playback at least. I'm planning to run some tests soon. In the meantime, if you would like to use the API above with BASS, you could do so via a user stream (see BASS_StreamCreate), ie. feed the decoded data into that.

marchiano

  • Posts: 1
Re: BASS for Android
« Reply #217 on: 18 Sep '12 - 11:26 »
How can i use BASSOPUS in Android to play opus track?

Ian @ un4seen

  • Administrator
  • Posts: 20389
Re: BASS for Android
« Reply #218 on: 18 Sep '12 - 17:26 »
You first need to copy the BASSOPUS libraries from "bassopus/libs" to your project's "libs" folder. Then, the simplest way to use BASSOPUS in your app is to load it via BASS_PluginLoad...

Code: [Select]
BASS.BASS_PluginLoad(getApplicationInfo().nativeLibraryDir+"/libbassopus.so", 0);

That will add OPUS support to the standard stream creation functions, eg. BASS_StreamCreateFile.

frandroid

  • Posts: 8
Re: BASS for Android
« Reply #219 on: 2 Oct '12 - 17:03 »
I have worked with BASS library without problems until i buy an htc one s. testing mi app with my new htc, the app crashed.

The problem is that I am creating a mp4(aac sound) video with MediaRecorder and i canīt open with  the example FXTest.
If i do the same in another device, as a Samsung galaxy tab 8, all works fine. And the better is that I play the video from Samsung on the Htc, itīs also works fine!! my fucking live....

When i try to open and play the video, there are not any errors, simply not sound. If i use bass_errorgetcode(), the error is 0 (all ok)

The BASS library is the last version. The code i think is correct, because works in other devices. I dont know whats is the problem. do you have any idea? can anyone check this in an htc series one?

the configuration for mediarecorder is this:
Code: [Select]
mediaRecorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
mediaRecorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);

CamcorderProfile profile = CamcorderProfile.get(CamcorderProfile.QUALITY_LOW);
mediaRecorder.setProfile(profile);

is the more basic configuration. I try with another, and the result is the same

thanks for your help!!
Fran

Ian @ un4seen

  • Administrator
  • Posts: 20389
Re: BASS for Android
« Reply #220 on: 3 Oct '12 - 13:52 »
BASS doesn't support video, so it isn't entirely clear to me how you are using BASS; can you clarify how you are doing that? Please also see if you get the crashing with the examples included in the BASS package, eg. the PLUGINS example. Note BASS doesn't support AAC/MP4 itself, so you will also need the BASS_AAC add-on (copy it into the project's "libs" folder) to play that format.

frandroid

  • Posts: 8
Re: BASS for Android
« Reply #221 on: 4 Oct '12 - 09:41 »
hi

i'm using BASS with the FXTest example. The code to open file is:

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.

at the moment, i am separating the video and the audio and then works fine.

thanks!!

Ian @ un4seen

  • Administrator
  • Posts: 20389
Re: BASS for Android
« Reply #222 on: 4 Oct '12 - 16:57 »
OK. Please upload the troublesome MP4 file that was created on the device to have a look at here...

   ftp.un4seen.com/incoming/

telostia

  • Posts: 1
Re: BASS for Android
« Reply #223 on: 5 Oct '12 - 01:45 »
Hi Ian,
 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!

Dan.
« Last Edit: 5 Oct '12 - 01:49 by telostia »

frandroid

  • Posts: 8
Re: BASS for Android
« Reply #224 on: 5 Oct '12 - 12:47 »
OK. Please upload the troublesome MP4 file that was created on the device to have a look at here...

   ftp.un4seen.com/incoming/

already have

thanks