Author Topic: BASS for Android  (Read 516593 times)

pony

  • Posts: 6
Re: BASS for Android
« Reply #1525 on: 29 Jan '19 - 09:49 »
 mRecorder = BASS.BASS_RecordStart(44100 ,1,0,null , 0); 

the value of "mRecorder" is always 6.  I check the permission ,but I have done set the permission.
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.RECORD_AUDIO " />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
I don't konw how to do ,so ask for help. thanks for any help.

Ian @ un4seen

  • Administrator
  • Posts: 21533
Re: BASS for Android
« Reply #1526 on: 29 Jan '19 - 16:39 »
Are you sure the BASS_RecordStart return value is 6? Perhaps you meant that the error code (from BASS_ErrorGetCode) is 6? If so, that is BASS_ERROR_FORMAT, which means the requested sample format wasn't accepted by OpenSLES. What happens if you use chans=2 in the BASS_RecordStart call? If you still have the problem in your app, please see if you can reproduce it with the RECTEST example that's included in the BASS package.

Oleg N

  • Posts: 97
Re: BASS for Android
« Reply #1527 on: 29 Jan '19 - 17:09 »
Newbie to Android here.

I've got the same problem with BASS_RecordStart() error 6 (BASS_ERROR_FORMAT), using NDK & C++:

BASS_RecordInit(0) - succeeds

BASS_GetConfig(BASS_CONFIG_FLOAT) returns 1

BASS_RecordGetInfo(&rinfo) succeeds but returns rinfo with zeroes for all fields except singlein = true

BASS_RecordStart(44100, 2, 0, nullptr, nullptr) fails with error 6,  and I tried many different parameter combinations.

permissions added:

    <uses-permission android:name="android.permission.RECORD_AUDIO"/>
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>

This equally happens on emulator and on device.

What could be wrong, please direct me.
« Last Edit: 30 Jan '19 - 08:40 by Oleg N »

pony

  • Posts: 6
Re: BASS for Android
« Reply #1528 on: 30 Jan '19 - 09:59 »
I think you are failed to set the permission. but I dno't know how to correct it.

gicci

  • Posts: 58
Re: BASS for Android
« Reply #1529 on: 30 Jan '19 - 11:54 »
I am revising the configuration of the samples in my channels, and I need some help to find the optimal one.

I have 3 channels:
  • A MIDI decoding channel on which I apply FX effects;
  • A waveform channel (16 bits samples) on which I apply FX effects;
  • A Mixer that sums the two before sending them to the output.
FX effects have the float option enabled.

I have the following questions:
  • Will using float for the MIDI channel provide better sound output for the MIDI to samples conversion?
  • Setting the Mixer with float does enable the sending of float samples to Android output, or using 16 bits will be the same?
Thank you for your help.

Oleg N

  • Posts: 97
Re: BASS for Android
« Reply #1530 on: 30 Jan '19 - 13:32 »
@Pony,

Looks like I've got permissions set up correctly, but still no luck.

I think you are failed to set the permission. but I dno't know how to correct it.

Quote
I've got the same problem with BASS_RecordStart() error 6 (BASS_ERROR_FORMAT), using NDK & C++:

BASS_RecordInit(0) - succeeds

BASS_GetConfig(BASS_CONFIG_FLOAT) returns 1

BASS_RecordGetInfo(&rinfo) succeeds but returns rinfo with zeroes for all fields except singlein = true

BASS_RecordStart(44100, 2, 0, nullptr, nullptr) fails with error 6,  and I tried many different parameter combinations.

permissions added:

    <uses-permission android:name="android.permission.RECORD_AUDIO"/>
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>

This equally happens on emulator and on device.


Oleg N

  • Posts: 97
Re: BASS for Android
« Reply #1531 on: 30 Jan '19 - 14:58 »
@Pony
You were right: I had to ask user for permission also. Once I did that it worked.

Ian @ un4seen

  • Administrator
  • Posts: 21533
Re: BASS for Android
« Reply #1532 on: 30 Jan '19 - 14:59 »
Pony and Oleg, I think I know what the problem is now. It's related to differences in permission granting when targetting Android 6 (API level 23) or above. Details can be found here:

   https://developer.android.com/guide/topics/permissions/overview

The solution is to either target a lower API level or use "requestPermissions" to request the needed permissions. The BASS examples have now been updated to do both, so you can re-download to check that.

Will using float for the MIDI channel provide better sound output for the MIDI to samples conversion?

BASSMIDI internally uses floating-point for the sample mixing (except on "armeabi" architecture), and then converts to 16-bit at the end if required. When the BASS_SAMPLE_FLOAT flag is set, it just skips that final step.

Setting the Mixer with float does enable the sending of float samples to Android output, or using 16 bits will be the same?

BASS will send floating-point data to the output device when running on Android 6 or above and the BASS_DEVICE_16BITS flag isn't used during initialization.

pony

  • Posts: 6
Re: BASS for Android
« Reply #1533 on: 31 Jan '19 - 09:07 »
I can't open the url in china.Could you Email the answer for me? my email: xin16176@qq.com  .thx
  https://developer.android.com/guide/topics/permissions/overview

Ian @ un4seen

  • Administrator
  • Posts: 21533
Re: BASS for Android
« Reply #1534 on: 31 Jan '19 - 14:15 »
If you are unable to access the android.com website directly, perhaps you can use archive.org to view it? For example:

   https://web.archive.org/web/20190115034642/https://developer.android.com/guide/topics/permissions/overview

If you can't get that either, entering "Android requestPermissions" into a search engine will hopefully get you the info too.

For a quick and easy fix, you can just put "targetSdkVersion 22" (or lower) in your project's build.gradle file.

chadr

  • Guest
Re: BASS for Android
« Reply #1535 on: 1 Feb '19 - 15:59 »
Hello.

The google said that starting August 1, 2019, the apps that published on Google Play will need to support 64-bit architectures.

https://developer.android.com/distribute/best-practices/develop/64-bit

So, How about supports x86_64 architecture as well?

Ian @ un4seen

  • Administrator
  • Posts: 21533
Re: BASS for Android
« Reply #1536 on: 1 Feb '19 - 16:52 »
x86_64 architecture support will be coming soon.

goobliata

  • Posts: 27
Re: BASS for Android
« Reply #1537 on: 6 Feb '19 - 07:41 »
+1 for x86_64 Android builds. Thanks.

vandenbrakel

  • Posts: 16
Re: BASS for Android
« Reply #1538 on: 6 Feb '19 - 17:34 »
Hi,

Using ManagedBass, we are struggeling finding the source of this error:
It seems the Load method is not present in the libbassenc.so (17-7-2018) for Android but we are not sure where the problem resides. On iOS we don't have this issue.

Any ideas?

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(5,5): Error MSB4018: The "LinkAssemblies" task failed unexpectedly.
Mono.Linker.MarkException: Error processing method: 'System.Boolean ManagedBass.Enc.BassEnc::Load(System.String)' in assembly: 'ManagedBass.Enc.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.IntPtr ManagedBass.DynamicLibrary::Load(System.String,System.String)
  at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod (Mono.Cecil.MethodReference reference) [0x00013] in <f064f1381131417c9bea7824c6ebfdf2>:0
  at Mono.Linker.Steps.MarkStep.MarkMethod (Mono.Cecil.MethodReference reference) [0x0004a] in <f064f1381131417c9bea7824c6ebfdf2>:0
  at Mono.Linker.Steps.MarkStep.MarkInstruction (Mono.Cecil.Cil.Instruction instruction) [0x00040] in <f064f1381131417c9bea7824c6ebfdf2>:0
  at Mono.Linker.Steps.MarkStep.MarkMethodBody (Mono.Cecil.Cil.MethodBody body) [0x00098] in <f064f1381131417c9bea7824c6ebfdf2>:0
  at Mono.Linker.Steps.MarkStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00162] in <f064f1381131417c9bea7824c6ebfdf2>:0
  at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x0001b] in <f064f1381131417c9bea7824c6ebfdf2>:0
   --- End of inner exception stack trace ---
  at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x00047] in <f064f1381131417c9bea7824c6ebfdf2>:0
  at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue () [0x0000a] in <f064f1381131417c9bea7824c6ebfdf2>:0
  at Mono.Linker.Steps.MarkStep.Process () [0x00102] in <f064f1381131417c9bea7824c6ebfdf2>:0
  at Mono.Linker.Steps.MarkStep.Process (Mono.Linker.LinkContext context) [0x0000d] in <f064f1381131417c9bea7824c6ebfdf2>:0
  at MonoDroid.Tuner.MonoDroidMarkStep.Process (Mono.Linker.LinkContext context) [0x0000b] in <f064f1381131417c9bea7824c6ebfdf2>:0
  at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x0001c] in <f064f1381131417c9bea7824c6ebfdf2>:0
  at MonoDroid.Tuner.Linker.Run (Mono.Linker.Pipeline pipeline, Mono.Linker.LinkContext context) [0x00000] in <f064f1381131417c9bea7824c6ebfdf2>:0
  at MonoDroid.Tuner.Linker.Process (MonoDroid.Tuner.LinkerOptions options, Mono.Linker.ILogger logger, Mono.Linker.LinkContext& context) [0x00071] in <f064f1381131417c9bea7824c6ebfdf2>:0
  at Xamarin.Android.Tasks.LinkAssemblies.Execute (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver res) [0x002d4] in <f064f1381131417c9bea7824c6ebfdf2>:0
  at Xamarin.Android.Tasks.LinkAssemblies.Execute () [0x0021f] in <f064f1381131417c9bea7824c6ebfdf2>:0
  at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00023] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/msbuild-15/src/Build/BackEnd/TaskExecutionHost/TaskExecutionHost.cs:573
  at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x001f6] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/msbuild-15/src/Build/BackEnd/Components/RequestBuilder/TaskBuilder.cs:784  (MSB4018) (AppDroidv2)