Author Topic: BASS for iOS (iPhone/iPad)  (Read 774220 times)

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for iOS (iPhone/iPad)
« Reply #1400 on: 5 Nov '20 - 16:47 »
What is the error code from the BASS_StreamCreateFile call? Use BASS_ErrorGetCode immediately after to check that. Are other file formats in the same location playing OK? If the problem is happening with a particular file, please upload that to have a look at here:

   ftp.un4seen.com/incoming/

ankitsaini

  • Posts: 3
Re: BASS for iOS (iPhone/iPad)
« Reply #1401 on: 10 Nov '20 - 14:52 »
I am getting this error code:
BASS_ERROR_FILEFORM    41    // unsupported file format

Other files are in .mp3 format on same location and playing fine but the problem only occurring with .mov, .m4a or .mp4 files.

What is the error code from the BASS_StreamCreateFile call? Use BASS_ErrorGetCode immediately after to check that. Are other file formats in the same location playing OK? If the problem is happening with a particular file, please upload that to have a look at here:

   ftp.un4seen.com/incoming/

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for iOS (iPhone/iPad)
« Reply #1402 on: 10 Nov '20 - 15:39 »
I just noticed in your post that you've put the BASS_STREAM_PRESCAN flag in the BASS_StreamCreateFile call's "offset" parameter. That could explain the BASS_ERROR_FILEFORM error because BASS doesn't see the file's headers then. Does the problem still happen if you change that to 0? If so, please upload one of the affected files to have a look at.

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for iOS (iPhone/iPad)
« Reply #1403 on: 4 Dec '20 - 17:12 »
The iOS versions of the BASSenc 2.4.15, BASSenc_FLAC 2.4.3, BASSenc_OGG 2.4.1, BASSenc_OPUS 2.4.2, BASSFLAC 2.4.4.5 releases are now up in the 1st post.

einsteinx2

  • Posts: 69
Re: BASS for iOS (iPhone/iPad)
« Reply #1404 on: 9 Mar '21 - 23:04 »
Hi Ian, I recently got my hands on a new M1 MacBook Air and have been setting it up as a secondary development machine. I ran into an issue regarding the simulator due to the fact that both the laptop and device are using arm64. I get the following linker error "ld: in libbass.a(libbass.a-arm64-master.o), building for iOS Simulator, but linking in object file built for iOS, file 'libbass.a'". Presumably it's trying to pull the arm64 build from the fat static library rather than the x86_64 since the laptop is now also arm64, however that version is meant for devices and not the simulator (not sure what the difference is but apparently there is one).

The answer is obviously to include an arm64 version for the simulator as well, but that presents the issue of having 2 different arm64 builds in the same fat lib, which is not possible as far as I know. Some quick searching seems to indicate that the only way around this is to have two separate static libs: one for simulator (including x86_64 and arm64) and one for device (including arm7 and arm64), then wrapping them in an XCFramework (Apple's new framework format). This allows for a single "file" (actually a folder but macOS sees it as a file) that works for all devices and architecture types.

I appreciate that there are probably not too many people currently using Apple Silicon Macs, and that testing is still possible by using a device and just skipping the simulator, but I figured I'd bring it to your attention if you weren't already aware.

If you're willing to create builds of all the BASS libraries for arm64 simulator (I currently am using bass, bass_ape, bass_fx, bass_mpc, bassflac, bassmix, bassopus, and basswv in my app...so I guess basically all of them ;D), I'm happy to take a stab at writing a script to package up the XCFrameworks and share that back once I get it working. Or if you already have done some work on this, I'm happy to beta test anything you have already.

Speaking of beta testing, I'm also looking into making my iOS app available on Mac via Catalyst, and I saw that you mentioned in another thread that you had a test version of the libraries for that a few months ago. I'd love to get my hands on those as well to do some testing as well on both my Intel and M1 Macs if you don't mind sharing them.

Thanks!

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for iOS (iPhone/iPad)
« Reply #1405 on: 10 Mar '21 - 16:39 »
Yep, this is an issue that I've been meaning to look into for a while (been preoccupied with BASS 2.4.16 so far this year). The iOS BASS libraries are currently universal binaries that include support for device and simulator builds, so you can simply link your app with the same files for both. The problem is that there can only be one slice per-architecture in a universal binary, and there's already one for arm64 devices, which means an arm64 simulator slice can't be added. So the BASS libraries will need to be split into two (one for devices and one for simulators) and then probably also put in an XCFramework. I finally looked into it today, and came up with this XCFramework:

   www.un4seen.com/stuff/bass-ios-test.zip

It seems to be working fine in my little tests so far, but let me know how you get on or if you have any tweak suggestions. One issue is that Xcode 11 or above is needed to use XCFrameworks (I think), but users of older Xcode versions could get around that by linking directly with the libraries within.

Regarding the Catalyst stuff, please drop me an email about that and I'll send you the test build to try.

einsteinx2

  • Posts: 69
Re: BASS for iOS (iPhone/iPad)
« Reply #1406 on: 5 Apr '21 - 23:25 »
Thanks for the quick reply! I took a few weeks off of working on the app, so I didn't get a chance to test the XCFramework yet, but I'll give it a try this week. Just sent you an email regarding the Catalyst build.

54tyy76

  • Posts: 3
Re: BASS for iOS (iPhone/iPad)
« Reply #1407 on: 6 Apr '21 - 04:01 »
Can "BASS for iOS" be used in the latest Xamarin.iOS?
I use Visual Studio for Mac 8.9.4.
I have tried various methods in this forum. Still no success.
Does anyone know where to find a simple demo?

Thanks!

Ryota

  • Posts: 28
Re: BASS for iOS (iPhone/iPad)
« Reply #1408 on: 14 Apr '21 - 06:46 »
Hi Ian,

When I test the following audio files with the latest version of BASS, the audio length is halved.

https://jyavenard.github.io/htmltests/mediatest/mp4/aac/SBRtestStereoAot29Sig1.mp4

Is there any solution?

Code: [Select]
HSTREAM hTempStream = BASS_StreamCreateFile(FALSE, (char *)[strFilepath UTF8String], 0, 0, BASS_SAMPLE_FLOAT | BASS_STREAM_DECODE | BASS_FX_FREESOURCE);
double dLength = BASS_ChannelBytes2Seconds(hTempStream, BASS_ChannelGetLength(hTempStream, BASS_POS_BYTE));

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for iOS (iPhone/iPad)
« Reply #1409 on: 14 Apr '21 - 17:18 »
Here's an update for you to try:

   www.un4seen.com/stuff/bass-ios-test.zip

It seems to fix the length for that file but let me know if you have trouble with any other AAC/MP4 files.

Ryota

  • Posts: 28
Re: BASS for iOS (iPhone/iPad)
« Reply #1410 on: 15 Apr '21 - 05:03 »
Thank you, Ian!

I tried the update version, and that works perfectly.

promusicbisceglie

  • Posts: 25
Re: BASS for iOS (iPhone/iPad)
« Reply #1411 on: 28 Apr '21 - 15:30 »
Hi i ve this problems since i update my sdk to ver. 14.5
-[DCC Error] E2597 Undefined symbols for architecture arm64:
    Error: "__ZdlPv", referenced from:      l067 in libbass_fx.a(libbass_fx.a-arm64-master.o);      _BASS_FX_BPM_Free in libbass_fx.a(libbass_fx.a-arm64-master.o);      l385 in libbass_fx.a(libbass_fx.a-arm64-master.o);
      Error: "__Znwm", referenced from:      l064 in libbass_fx.a(libbass_fx.a-arm64-master.o);      l381 in libbass_fx.a(libbass_fx.a-arm64-master.o);
      Error: "__ZdaPv", referenced from:      l280 in libbass_fx.a(libbass_fx.a-arm64-master.o);      l305 in libbass_fx.a(libbass_fx.a-arm64-master.o);

If i remove libbass_fx.a my project works.
Any solution?
I use delphi rad studio


Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for iOS (iPhone/iPad)
« Reply #1412 on: 28 Apr '21 - 16:25 »
That looks like it isn't linking with the stdc++ library. I'm not familiar with delphi rad studio, so I'm not sure how you would tell it to link that. If it allows you to specify custom linker options, try adding "-lstdc++" there.

Chris

  • Posts: 2216
Re: BASS for iOS (iPhone/iPad)
« Reply #1413 on: 28 Apr '21 - 17:54 »

promusicbisceglie

  • Posts: 25
Re: BASS for iOS (iPhone/iPad)
« Reply #1414 on: 4 May '21 - 11:31 »
10.4.1 licensed with all available patch installed

promusicbisceglie

  • Posts: 25
Re: BASS for iOS (iPhone/iPad)
« Reply #1415 on: 4 May '21 - 11:41 »
That looks like it isn't linking with the stdc++ library. I'm not familiar with delphi rad studio, so I'm not sure how you would tell it to link that. If it allows you to specify custom linker options, try adding "-lstdc++" there.
nope .... [DCC Error] E2597 ld: library not found for -lstdc++  :'(
i use Delphi not C++
« Last Edit: 4 May '21 - 11:53 by promusicbisceglie »

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for iOS (iPhone/iPad)
« Reply #1416 on: 6 May '21 - 14:21 »
BASS_FX requires the standard C++ library, so you will need to link your app to it even if you're using Delphi. You could try putting "-lc++" there instead of "-lstdc++". If that doesn't work either, what iOS SDK version are you currently using, and is it possible to try an older version to see if that makes any difference?

promusicbisceglie

  • Posts: 25
Re: BASS for iOS (iPhone/iPad)
« Reply #1417 on: 6 May '21 - 18:03 »
now i 've add -lc++ but i have  same error : -[DCC Error] E2597 Undefined symbols for architecture arm64: etc....
My complete linker parameters are :
"-lc++ -lz -framework SystemConfiguration -weak_framework Social -weak_framework iAd -framework StoreKit -framework MessageUI -framework AudioToolbox -weak_framework AdSupport -framework Security -framework CoreData -framework EventKit -framework AVFoundation -framework CoreTelephony -framework EventKitUI -framework CoreMedia -framework CoreBluetooth -weak_framework SafariServices -weak_framework CoreMotion -framework MediaPlayer -framework CoreVideo -weak_framework MobileCoreServices"

This happen with the last skd 14.5 ... older sdk version (13.6) do not have this problem but apple requires the last SDK to publish now...
 

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for iOS (iPhone/iPad)
« Reply #1418 on: 7 May '21 - 18:06 »
Here's a BASS_FX build (with a more recent XCode/SDK than the current release) for you to try:

   www.un4seen.com/stuff/bass_fx-ios.zip

Note it's in the newer XCFramework form. If Delphi doesn't support that, you can extract the libbass_fx.a library from within.

punit.silversky

  • Posts: 2
Re: BASS for iOS (iPhone/iPad)
« Reply #1419 on: 15 May '21 - 13:33 »
Hello Guys,

Can anyone please share iOS examples with Xcode integration? I can't seem to find any.

Thanks in advance

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for iOS (iPhone/iPad)
« Reply #1420 on: 17 May '21 - 17:20 »
Unfortunately, there currently aren't any official examples for iOS, but you basically just need to #include the bass.h file (take that from the Windows/Linux/macOS BASS package) in your code and add the libbass.a file to your project's "Link Binary With Libraries" settings (also add the required frameworks from the first post there). That's when using Objective-C, at least. I'm not a Swift user, so I'm not sure about that.

Regarding the actual code, the BASS function calls will be basically the same on all platforms, so you could have a look at the examples included in the other platform packages for pointers.

promusicbisceglie

  • Posts: 25
Re: BASS for iOS (iPhone/iPad)
« Reply #1421 on: 18 May '21 - 18:08 »
Nope  :'(
I tryed just compiling  64armv7 or i386 ... same problem...
I use bass, bass_midi, and now bass_enc and them works great... problem is just when i use libbass_fx.a
i need use only and just 2 functions...
//function BASS_FX_GetVersion: DWORD; cdecl; external 'libbass_fx.a' name 'BASS_FX_GetVersion';
  //function BASS_FX_TempoCreate(chan, flags: DWORD): HSTREAM; cdecl; external 'libbass_fx.a' name 'BASS_FX_TempoCreate';

punit.silversky

  • Posts: 2
Re: BASS for iOS (iPhone/iPad)
« Reply #1422 on: 19 May '21 - 07:57 »
Unfortunately, there currently aren't any official examples for iOS, but you basically just need to #include the bass.h file (take that from the Windows/Linux/macOS BASS package) in your code and add the libbass.a file to your project's "Link Binary With Libraries" settings (also add the required frameworks from the first post there). That's when using Objective-C, at least. I'm not a Swift user, so I'm not sure about that.

Regarding the actual code, the BASS function calls will be basically the same on all platforms, so you could have a look at the examples included in the other platform packages for pointers.

Hi, Ian

Thanks for the quick reply, I will try that you have suggested

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for iOS (iPhone/iPad)
« Reply #1423 on: 19 May '21 - 15:56 »
Nope  :'(
I tryed just compiling  64armv7 or i386 ... same problem...
I use bass, bass_midi, and now bass_enc and them works great... problem is just when i use libbass_fx.a
i need use only and just 2 functions...
//function BASS_FX_GetVersion: DWORD; cdecl; external 'libbass_fx.a' name 'BASS_FX_GetVersion';
  //function BASS_FX_TempoCreate(chan, flags: DWORD): HSTREAM; cdecl; external 'libbass_fx.a' name 'BASS_FX_TempoCreate';

The big difference is that none of those other BASS/add-on libraries require the standard C++ library. From the RAD Studio docs, it looks like the solution may be to add "dependency" info in the bass_fx.pas file:

   http://docwiki.embarcadero.com/RADStudio/Seattle/en/Procedures_and_Functions#Specifying_Dependencies_of_the_Library

Something like this?

Code: [Select]
function BASS_FX_GetVersion: DWORD; cdecl; external 'libbass_fx.a' dependency 'c++';

promusicbisceglie

  • Posts: 25
Re: BASS for iOS (iPhone/iPad)
« Reply #1424 on: 20 May '21 - 11:04 »
I'm become a little crazy  :'( :-\

i add to linker param :         -lc++
My 2 function are..
function BASS_FX_GetVersion: DWORD; cdecl; external 'libbass_fx.a' dependency 'c++' name 'BASS_FX_GetVersion' ;
function BASS_FX_TempoCreate(chan, flags: DWORD): HSTREAM; cdecl; external 'libbass_fx.a' dependency 'c++' name 'BASS_FX_TempoCreate';

same error...
    Error: "__Znwm", referenced from:      l082 in libbass_fx.a(libbass_fx.a-arm64-master.o);      l320 in libbass_fx.a(libbass_fx.a-arm64-master.o);
      Error: "__ZdlPv", referenced from:      _BASS_FX_BPM_Free in libbass_fx.a(libbass_fx.a-arm64-master.o);      l085 in libbass_fx.a(libbass_fx.a-arm64-master.o);      l322 in libbass_fx.a(libbass_fx.a-arm64-master.o);
      Error: "__ZdaPv", referenced from:      l251 in libbass_fx.a(libbass_fx.a-arm64-master.o);      l486 in libbass_fx.a(libbass_fx.a-arm64-master.o);

Why with ios sdk 13.6 this has worked great  without any c++ dependency???(now is not possibile use sdk 13.6 i must use sdk 14.x)

Can this '_BASS_FX_BPM_Free in libbass_fx.a'  be removed or modified ?? may be this 'function' generate problems?? 

this is my order num...... Fattura dell'ordine n. 568310653 del 24-LUG-2018
« Last Edit: 20 May '21 - 11:35 by promusicbisceglie »