22 May '13 - 14:18 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
  Home Help Search Login Register  
  Show Posts
Pages: [1] 2 3 ... 6
1  Developments / BASS / Re: BASS for Android on: 18 May '13 - 19:35
put this in proguard.cfg:
-keep class com.un4seen.bass.** {
  public protected private *;
}

Thanks - this was driving me nuts!  Tongue
ReplyReply Reply with quoteQuote
2  Developments / BASS / BASS for Android - Record from Mic to file 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
ReplyReply Reply with quoteQuote
3  Developments / BASS / Re: BASS for Android on: 17 May '12 - 18:37
I just checked, and it seemed to be fine, ie. BASS_FX was loaded and the reverse processing applied, so that's strange. After replacing the SO and/or Java files, be sure to "Refresh" the corresponding project branch in Eclipse. If it's still not working after that, please confirm the date and size of the SO files in your app's APK file (it's a ZIP file). Also confirm which line the error message is appearing at; I guess it's the BASS_FX_ReverseCreate call?

Thanks Ian for confirming it works ok your end.

Allthough "libbass_fx.so" in  my eclipse libs tree "armeabi" and "armeabi-v7a" were showing fine with no errors when I clicked on properties they showed as missing. Copied them from bass_fx zip folder and it's now sorted.
Was sure I checked everything!  Huh

thanks for the quick response and the updates.
ReplyReply Reply with quoteQuote
4  Developments / BASS / Re: BASS for Android on: 17 May '12 - 14:58
Hi,

I've got a problem with the latest version of bass_fx.

I wanted the latest bass cause i wanted to use the new BASS.Asset(getAssets() feature which works fine. However I can no longer use bass_fx without an error even after downloading the lastest bass_fx,

I have opened the new bass_fx.java and can see the new stuff when comparing it to my previous version.
If I revert both bass and bass_fx then the errors go away but of course I cannot use BASS.Asset(getAssets().

The error in logcat is:
05-17 14:41:49.033: E/AndroidRuntime(28930): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load bass_fx: findLibrary returned null

I have not changed my calling code, but here my reverse play:
//reverse
if (Style==3){

BASS.BASS_ChannelRemoveFX(stream1, fxHandle);
BASS.BASS_StreamFree(stream1);

        if ((stream1=BASS.BASS_StreamCreateFile(quizstart.Tracks.get(CurrentQ).path, 0, 0, BASS.BASS_STREAM_DECODE|BASS.BASS_STREAM_PRESCAN))==0) {
Error("Can't play the file");
sb.setMax(0);
return;
}

        stream1 = BASS_FX.BASS_FX_ReverseCreate(stream1, 2f, BASS_FX.BASS_FX_FREESOURCE);
        BASS.BASS_ChannelSetAttribute(stream1,  BASS_FX.BASS_ATTRIB_REVERSE_DIR, -1f);

            long len = BASS.BASS_ChannelGetLength(stream1, BASS.BASS_POS_BYTE);
        BASS.BASS_ChannelSetPosition(stream1, (len/3), BASS.BASS_POS_BYTE);
        BASS.BASS_ChannelPlay(stream1, false);

int sometime=10;
sometime=Integer.parseInt(quizmain.ListPreference);

sb.setMax(sometime * 1000);
quiztime =0;
StopQuizTimerThread=false;
questionhandler.postDelayed(r, 100);

return;
} //reverse

ReplyReply Reply with quoteQuote
5  Developments / BASS / Re: BASS for Android on: 6 Apr '12 - 12:56
Meanwhile... a partial BASS_FX port is now up in the first post. The reverse/tempo/bpm/beat stuff is included, but not the BASS_FX_BFX_xxx effects, which need more work regarding conversion to fixed-point. One difference to note compared to other platforms is that the BASS_ATTRIB_TEMPO_OPTION_USE_QUICKALGO option is enabled by default on tempo streams for lower CPU usage, but it can be disabled via BASS_ChannelSetAttribute if wanted. A BASS library update is also up in the first post, which is required by the BASS_FX port.

Woo Hoo, Brilliant !

Thank you for the quick response. BASS_FX reverse and tempo working great.

Big big thanks to all concerned!
ReplyReply Reply with quoteQuote
6  Developments / BASS / Re: BASS for Android on: 4 Apr '12 - 08:59
Without seeming to be two pushy, when you say BASS_FX is still some way off would we be talking about more than a month away. Reason being is that I'd hold off on publishing this app if there was a chance it was on it's way in round about that time frame?

I'll check with Arthur to see what can be done.

Have you had a response back from Arthur? Just need the reverse and tempo elements...
ReplyReply Reply with quoteQuote
7  Developments / BASS / Re: BASS for Android on: 23 Mar '12 - 18:41
The update including the other DX8 effects (CHORUS/DISTORTION/ECHO/FLANGER/REVERB) is now up in the 1st post. The effects seem to be working quite nicely so far, but please report if you encounter any problems with them.

Brilliant!

I can confirm that echo, distortion, chorus & flanger all work perfectly for me, big thanks.

Without seeming to be two pushy, when you say BASS_FX is still some way off would we be talking about more than a month away. Reason being is that I'd hold off on publishing this app if there was a chance it was on it's way in round about that time frame?

Mark Grin
ReplyReply Reply with quoteQuote
8  Developments / BASS / Re: BASS for Android on: 23 Mar '12 - 16:37
Quote

I think the availability of a complete Android port of BASS_FX is still some way off at the moment (it requires quite a bit of modification to use fixed-point instead of floating-point), but I guess it may be possible to have a partial port sooner. Regarding sample code for reversing, here is the original code that BASS_FX's reverse processing is based on...

   www.un4seen.com/forum/?topic=897.msg4764#msg4764

Thanks Ian, Converting that reverse code looks to be a bit beyond my experience specially being new to Java and not a C programmer either. I guess I'll have to wait for the partial port of BASS_FX. I'd be ideally looking for the reverse and  tempocreate functions  Grin

Would you update the date of the android download on page 1 when the DX8 update has been added then I will give it a go?

thanks again.
Mark
ReplyReply Reply with quoteQuote
9  Developments / BASS / Re: BASS for Android on: 21 Mar '12 - 14:56
Is it still the case that the only DX8 effect that currently supported in android bass is PARAMEQ?
Will the other effects be added, ie echo, distortion etc?

Yes, PARAMEQ is currently the only DX8 effect supported on Android, but the others may well be added in future. I'll have a look at that next week.

Also I have a requirement to play a stream in reverse, is this something that can be done in bass android now or will I need to wait for BASS_FX for android?

It is possible to implement the reverse processing yourself, using a decoding channel (BASS_STREAM_DECODE) to decode the file and a custom stream (BASS_StreamCreate) to play it. Your STREAMPROC function would decode a block of data from the end of the file and reverse the order of the samples in it. It would then deliver the data to BASS as it is requested, and when it's finished that, it would set (using BASS_ChannelSetPosition) the decoder back to the next block and repeat. If you will be playing MP3 files, then you should use the BASS_STREAM_PRESCAN flag when doing this, to enable accurate seeking.

Hi Ian

Is there any news on when the additional PARAMEQ effects will be available?

Also will it be possible to implement BassFx.BASS_FX_TempoCreate stream in android?

Just revisiting the reverse effect, will  BASS_FX  be added at some point as I have that working in my .Net program which I'm trying to port to android, but struggling to achieve using the methods you described above. If BASS_FX is a long way off could you steer me in the direction of some sample code perhaps?

thanks
Mark
ReplyReply Reply with quoteQuote
10  Developments / BASS / Re: BASS for Android on: 9 Mar '12 - 09:01
Is it still the case that the only DX8 effect that currently supported in android bass is PARAMEQ?
Will the other effects be added, ie echo, distortion etc?

Also I have a requirement to play a stream in reverse, is this something that can be done in bass android now or will I need to wait for BASS_FX for android?

thanks
ReplyReply Reply with quoteQuote
11  Developments / BASS / Re: BASS for Android on: 8 Mar '12 - 11:19
Thank you Ian, you correctly identified the problem.

That looks like the problem is the path of the BASS.JAVA file, which needs to match the BASS package name ("com.un4seen.bass"). The simplest way (without any file copying) to add the BASS class to your project is to use Eclipse's "Build Path > Link Source" option to import the root "src" folder. If you name the folder "bass", then the project should look something like the attachment in this post...

   www.un4seen.com/forum/?topic=13225.msg92103#msg92103
ReplyReply Reply with quoteQuote
12  Developments / BASS / Re: BASS for Android on: 7 Mar '12 - 11:20
I'm having problems getting the examples to work, specifically rectest.

I think I've done everything correctly eg "Create project from existing source", import the bass class, linked and copied the lib folder.

In elipse project I can see bass.java & rectest.java files in src. armeabi & armeabi-v7a folders and library files are shown in libs folder.

When I run the project on my phone it crashes.

I've set an early breakpoint and it fails at "BASS.BASS_RecordInit(-1)" in the rectest example code.

Logcat displays:
03-07 10:57:08.447: D/dalvikvm(1517): GC_EXPLICIT freed 85K, 50% free 4367K/8583K, external 7092K/8856K, paused 76ms
03-07 10:57:12.881: D/PowerManagerService(1371): New lightsensor value:320, lcdValue:101
03-07 10:57:12.881: D/PowerManagerService(1371): lightSensorChangedLocked, buttonValue >= 0, mPowerState = 3
03-07 10:57:16.885: D/dalvikvm(3504): Trying to load lib /data/data/com.example.rectest/lib/libbass.so 0x4051d598
03-07 10:57:16.955: D/dalvikvm(3504): Added shared lib /data/data/com.example.rectest/lib/libbass.so 0x4051d598
03-07 10:57:16.955: W/dalvikvm(3504): No implementation found for native Lcom/example/rectest/BASS;.BASS_RecordInit (I)Z
03-07 10:57:36.875: D/dalvikvm(3504): Calling exit(1)
03-07 10:57:36.895: I/ActivityManager(1371): Process com.example.rectest (pid 3504) has died.

I've checked the .apk file and that contains bass libraries.

Any clues as to what I've missed?

thanks
Mark


ReplyReply Reply with quoteQuote
13  Developments / BASS / Re: looped sample taken from playing stream, length in time no correct on: 7 Sep '11 - 17:53
The BASS_CONFIG_BUFFER setting needs to be set prior to creating a new output stream.
So do it before calling BASS_StreamCreateFile...etc.

Ahhhhh! I was setting it in the echo sub not when starting a new track!

Thanks radio42 for the hint and thanks to Ian for all your patience in getting this to work!!!!

Yippee
 Tongue
ReplyReply Reply with quoteQuote
14  Developments / BASS / Re: looped sample taken from playing stream, length in time no correct on: 7 Sep '11 - 17:29
OK. That confirms that it is the playback buffer length that is the root of the delay. Are you sure you're not setting the BASS_CONFIG_BUFFER option somewhere in your code? The default is 500ms, but your BASS_DATA_AVAILABLE readings are higher than that, like it has been set to something like 5000ms.

Sorry I do set it in the form load sub when the sample loop form opens:
Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_BUFFER, 10000)

What would I need to do to rectify this, i've tried setting it in the echo effect sub to "Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_BUFFER, 10)" but it makes no difference to the delay?
ReplyReply Reply with quoteQuote
15  Developments / BASS / Re: looped sample taken from playing stream, length in time no correct on: 7 Sep '11 - 16:08
What is the breakdown of those numbers, ie. how much is BASS_DATA_AVAILABLE and how much is BASS_Split_StreamGetAvailable?
before sample loop code it returns values like:
BASS_DATA_AVAILABLE 79004
BASS_Split_StreamGetAvailable 0
0.447868480725624

BASS_DATA_AVAILABLE 79804
BASS_Split_StreamGetAvailable 0
0.452403628117914

after sample loop code and playing a new track without running sample loop code, the echo effect debug returns values like:
BASS_DATA_AVAILABLE 766008
BASS_Split_StreamGetAvailable 0
4.34244897959184

BASS_DATA_AVAILABLE 871796
BASS_Split_StreamGetAvailable 0
4.94215419501134
[/quote]


Quote
Clearing the playback buffer is always likely to result in an audible glitch, so you will want to avoid that if possible. It looks like you're setting the effect on the playback stream (not the source), so I think the effects delay will actually be due to the playback buffer alone, not the splitter buffer. Are you making any BASS_CONFIG_BUFFER adjustments? Note the setting only applies at the time of a stream's creation, ie. an existing stream won't be affected by changes.
I set this just prior to setting up the streams and again when I open the sample loop form:
Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_SPLIT_BUFFER, 10000)
ReplyReply Reply with quoteQuote
16  Developments / BASS / Re: looped sample taken from playing stream, length in time no correct on: 6 Sep '11 - 17:44
To confirm what delay to expect, you can check how much buffered data there is, like this...

DWORD bytes=BASS_ChannelGetData(stream, 0, BASS_DATA_AVAILABLE) // data in playback buffer
+BASS_Split_StreamGetAvailable(stream); // data in splitter buffer
double seconds=BASS_ChannelBytes2Seconds(stream, bytes); // convert to seconds

Does that match the delay that you're hearing?

Yes it does.

Dim bytes = Bass.BASS_ChannelGetData(Stream, 0, Un4seen.Bass.BASSData.BASS_DATA_AVAILABLE)
bytes = bytes + BassMix.BASS_Split_StreamGetAvailable(Stream)
Dim seconds As Double = Bass.BASS_ChannelBytes2Seconds(Stream, bytes)
Console.WriteLine(seconds)

echo effect code...

before sample loop code it returns values like:
0.440839002267574
0.488934240362812

after sample loop code and playing a new track without running sample loop code, the echo effect debug returns values like:
4.1750566893424
4.9027664399093

So I added this which kinda fixes it but you sometimes hear a very small jump in the track position:
Public Sub SplitReset()
    Dim offset As Integer = BassMix.BASS_Split_StreamGetAvailable(Stream)
    offset = offset + Bass.BASS_ChannelGetData(Stream, 0, Un4seen.Bass.BASSData.BASS_DATA_AVAILABLE)
    BassMix.BASS_Split_StreamResetEx(Stream, offset)
End Sub

I have to call this code each time I turn on or off any effect including the equalizer and when adjusting an effect option like echo delay to prevent the 5 second delay.

You really notice the track jump when the above code gets called multiple times like when moving a slider for one of the effect variables or equalizer gains. For example I have this code to increase the echo delay which calls the SplitReset code many times as the slider is moved:
SplitReset()  'new bit
Bass.BASS_ChannelRemoveFX(Stream, fxEchoHandle)
Dim echo As New BASS_DX8_ECHO(90.0F, 50.0F, 500.0F, 500.0F, True)
fxEchoHandle = Bass.BASS_ChannelSetFX(Stream, BASSFXType.BASS_FX_DX8_ECHO, 1)
echo.fWetDryMix = Me.echo_wetdrymix.Value
echo.fLeftDelay = Me.echo_delay.Value
echo.fRightDelay = Me.echo_delay.Value
Bass.BASS_FXSetParameters(fxEchoHandle, echo)
Bass.BASS_ChannelPlay(Stream, False)
echoON = True
I've tried calling the SplitReset only once per effect option change but then the delay returns on subsequent effect option changes, on the same effect.

Is my SplitReset code the best solution and if so can you advise if there is a way to prevent hearing the playing track jumping?
ReplyReply Reply with quoteQuote
17  Developments / BASS / Re: looped sample taken from playing stream, length in time no correct on: 6 Sep '11 - 12:32
Do you mean there's a delay in the effect becoming audible, and if so, does the delay correspond to the sample length?

Yes there is a delay of approx 5 seconds before the echo effect becomes audible. There is also the same delay when turning off the effect.
It does not correspond to the sample length, i.e. if I set the sample to be 1 second long then play another track without applying any sample loop but use the echo sub routine above there is always a delay of approx 5 seconds.

Quote
The sample processing will take data from the source and place it in the splitter buffer, and the playback splitter stream will then play that before it gets more data from the source. If you apply an effect to the source after the sample processing, the effect won't be present in the buffered data and it will only be heard once the fresh source data begins.
I think I understand what you are saying but when I play a new track (fresh source) and run my echo effect code then I would expect the echo effect to play and cancel immediately without the 5 second delay, based on what you say?
ReplyReply Reply with quoteQuote
18  Developments / BASS / Re: looped sample taken from playing stream, length in time no correct on: 3 Sep '11 - 10:04
Just when I thought it was perfect...

When applying an effect after running my sample loop code and switching tracks there is a delay of approx 5 seconds when applying and disabling the effect.
The delay does not happen if the effect is applied to the stream while the loop code is looping or when the loop code is stopped but starts delaying when subsequent tracks are played with or without the sample loop code being executed. The effect delay problem continues every time I run any of my existing effects code until the application is closed and restarted.

I've tried setting the BASS_CONFIG_BUFFER back to it's default level and lower (200) in each effect sub but this makes no difference to the 5 second delay on effects.

One of my effects code:
Public Sub doecho()

If Me.CheckBox1.Checked = True Then
    Bass.BASS_ChannelRemoveFX(Stream, fxEchoHandle)
    'Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_BUFFER, 500)
    Dim echo As New BASS_DX8_ECHO(90.0F, 50.0F, 500.0F, 500.0F, True)
    fxEchoHandle = Bass.BASS_ChannelSetFX(Stream, BASSFXType.BASS_FX_DX8_ECHO, 1)
    echo.fWetDryMix = Me.echo_wetdrymix.Value
    echo.fLeftDelay = Me.echo_delay.Value
    echo.fRightDelay = Me.echo_delay.Value
    Bass.BASS_FXSetParameters(fxEchoHandle, echo)
    Bass.BASS_ChannelPlay(Stream, False)
    echoON = True
Else
    echoON = False
    Bass.BASS_ChannelRemoveFX(Stream, fxEchoHandle)
End If

End Sub

Release code when sample loop is finished:
Bass.BASS_ChannelStop(samplechannel)
Bass.BASS_StreamFree(samplechannel)
Me.Timer1.Enabled = False
loopOn = False

The timer dictates when the sample loop starts playing "Bass.BASS_ChannelPlay(samplechannel, True)" and in normal circumstances is already disabled so is just a fail safe.

Perhaps after my loop code has been executed something is not being released or a config setting is effecting the effects, any ideas?

thanks
Mark
ReplyReply Reply with quoteQuote
19  Developments / BASS / Re: BASS_ChannelSetSync not firering on: 19 Aug '11 - 17:27
I have confirmed that BASS_ChannelSetSync is being set in the future (beyond the current playing position).

The sync position actually needs to be ahead of the decoding position, not only the playback position (which is behind due to buffering), ie. the sync won't be triggered if the position has already been processed and is waiting to be heard in the playback buffer. The decoding position is available by using the BASS_POS_DECODE flag in a BASS_ChannelGetPosition call, so you could compare the sync position with that to confirm whether it is sufficiently in future. Let me know if the syncs still aren't firing even when set ahead of the decoding position.

Okay that makes sense and setting BASS_POS_DECODE flag makes the sync fire every time but at a much later time than I required.

What I fail to understand is why it works perfectly however many times I set the sync until the change tracks. (without BASS_POS_DECODE)

Also If I have to use the BASS_POS_DECODE flag how can I accurately set a sync say 2 seconds from the current track heard position?

Depending on what track is playing streambytes + length can be between 5 and 16 seconds ahead when it should have beem around 2 seconds.

Perhaps I've not understood, probably!!   Huh

Help
ReplyReply Reply with quoteQuote
20  Developments / BASS / BASS_ChannelSetSync not firering on: 19 Aug '11 - 13:48
I'm having a problem with BASS_ChannelSetSync, this is the senario:
I play a stream and then use this code to set a sync to play a sample_loop at a given time.
Dim streambytes As Int32 = Bass.BASS_ChannelGetPosition(Stream, BASSMode.BASS_POS_BYTES)
_sync = New SYNCPROC(AddressOf SetPosition)
Bass.BASS_ChannelRemoveSync(Stream, _syncer)
_syncer = Bass.BASS_ChannelSetSync(Stream, BASSSync.BASS_SYNC_POS Or BASSSync.BASS_SYNC_ONETIME, streambytes + length, _sync, IntPtr.Zero)
Me.Text = "sync set " & Bass.BASS_ChannelBytes2Seconds(Stream, streambytes + length) 'DEBUG DISPLAY TIME OF NEXT SYNC

This is the syncproc
Private Sub SetPosition(ByVal handle As Integer, ByVal channel As Integer, ByVal data As Integer, ByVal user As IntPtr)
    Bass.BASS_ChannelPlay(samplechannel, True)
End Sub

The sync is set to current playing position(streambytes) plus (length) which is the length between two beats.

I've checked that the sync time is set ahead of the current playing position as displayed in form title (Me.Text)

Now everything works as I expect, the sync is set and the samplechannel is played at the specified time.

I then use
Bass.BASS_ChannelRemoveSync(Stream, _syncer)
to remove the sync before I reuse it again via a loop button.
Each time the syncproc SetPosition triggers as expected but the problem is that when I stop the playing stream and either restart (play) it again or play another track, the syncproc never triggers again. I have confirmed that BASS_ChannelSetSync is being set in the future (beyond the current playing position).

This is the code I use to play the stream:
Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero)
Bass.BASS_SetVolume((VolumeCtl.Value / 2) / 100)
Bass.BASS_StreamFree(Stream)
Dim mixver As String = BassMix.BASS_Mixer_GetVersion
Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_SPLIT_BUFFER, 10000)
decoder = Bass.BASS_StreamCreateFile(file, 0L, 0L, BASSFlag.BASS_STREAM_DECODE)
split = BassMix.BASS_Split_StreamCreate(decoder, BASSFlag.BASS_STREAM_DECODE, Nothing)
Stream = BassFx.BASS_FX_TempoCreate(split, BASSFlag.BASS_FX_FREESOURCE Or BASSFlag.BASS_MUSIC_AUTOFREE)
If Stream <> 0 Then Bass.BASS_ChannelPlay(Stream, True)

This is the stop play code:
Bass.BASS_ChannelStop(samplechannel) 'stop the sample_loop channel
Bass.BASS_StreamFree(samplechannel)
Bass.BASS_ChannelStop(Stream) 'stop the playing stream
Bass.BASS_StreamFree(Stream)

Any ideas?
ReplyReply Reply with quoteQuote
Pages: [1] 2 3 ... 6
Powered by SMF 1.1.18 | SMF © 2013, Simple Machines