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

Ian @ un4seen

  • Administrator
  • Posts: 23889
Re: BASS for iOS (iPhone/iPad)
« Reply #1450 on: 27 Jul '21 - 12:11 »
I initially tried to set BASS_CONFIG_IOS_SESSION to 0 for configuring audio session category to AVAudioSessionCategoryPlayback, and it didn't worked. Then I tried to set it to different values (e.g., BASS_IOS_SESSION_MIX, BASS_IOS_SESSION_DISABLE, etc.), but none of them worked.

For your information, I tried to make a new project, configured all required frameworks (Accelerate, AudioToolbox, AVFoundation, CFNetwork, SystemConfiguration), added libbass.xcframework (with setting "Embed & Sign" on the project setting panel), and added some codes in AppDelegate.swift (or AppDelegate.m for Objective-C) like this:
Code: [Select]
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
  print(BASS_GetVersion())
  BASS_SetConfig(DWORD(BASS_CONFIG_IOS_SESSION), DWORD(BASS_IOS_SESSION_DISABLE))
 
  return true
}

BASS_GetVersion() worked well (i.e., the BASS library is loaded), but calling BASS_SetConfig throws an error "EXC_BAD_ACCESS (code=1, address=0x0)". The test was proceeded on the iPhone with the latest iOS (iOS 14.7) and Simulator. The latest Xcode (12.5.1) was used. Please let me know if I can provide any further information. Thanks.

Ah! I see now there is indeed a problem when trying to set BASS_CONFIG_IOS_SESSION before either BASS_Init or BASS_GetDeviceInfo/RecordGetDeviceInfo has been called. An update to fix that is up now in the first post. Please try that and let me know if you still have the problem with it.

Is there bass_midi.h file like bass.h?

I am trying to call BASS_MIDI_FontInit(...) to start with.

The C/C++ headers are the same on all platforms, so you can take the BASSMIDI.H file from one of the Win32/Linux/macOS BASSMIDI packages on the BASS webpage. The documentation can also be taken from those packages.

jnyang

  • Guest
Re: BASS for iOS (iPhone/iPad)
« Reply #1451 on: 27 Jul '21 - 13:51 »
Ah! I see now there is indeed a problem when trying to set BASS_CONFIG_IOS_SESSION before either BASS_Init or BASS_GetDeviceInfo/RecordGetDeviceInfo has been called. An update to fix that is up now in the first post. Please try that and let me know if you still have the problem with it.

The latest update works well when I try to set BASS_CONFIG_IOS_SESSION before calling BASS_Init. Thanks for your quick fix! :D

Anthony Y

  • Posts: 11
BASSMIDI.H
« Reply #1452 on: 28 Jul '21 - 01:01 »
Regarding your reply:
The C/C++ headers are the same on all platforms, so you can take the BASSMIDI.H file from one of the Win32/Linux/macOS BASSMIDI packages on the BASS webpage. The documentation can also be taken from those packages.

-----

I have downloaded bass24-osx and found bass.h but I can't find bassmidi.h anywhere. Not in bass24-ios.zip too.
Can you please provide me a link where I can download the header files? I need enc, enc_mp3 as well.

jnyang

  • Guest
Re: BASSMIDI.H
« Reply #1453 on: 28 Jul '21 - 10:53 »
I have downloaded bass24-osx and found bass.h but I can't find bassmidi.h anywhere. Not in bass24-ios.zip too.
Can you please provide me a link where I can download the header files? I need enc, enc_mp3 as well.

You can find it on the "add-ons" section of the BASS library page.
http://www.un4seen.com/bass.html#addons

Anthony Y

  • Posts: 11
Re: BASSMIDI.H
« Reply #1454 on: 28 Jul '21 - 11:58 »
I have downloaded bass24-osx and found bass.h but I can't find bassmidi.h anywhere. Not in bass24-ios.zip too.
Can you please provide me a link where I can download the header files? I need enc, enc_mp3 as well.

You can find it on the "add-ons" section of the BASS library page.
http://www.un4seen.com/bass.html#addons

Holy Moly! why didn't I see that. Thank you so much.

Ian @ un4seen

  • Administrator
  • Posts: 23889
Re: BASS for iOS (iPhone/iPad)
« Reply #1455 on: 30 Jul '21 - 17:38 »
The iOS version of the BASSHLS 2.4.3 release is up in the 1st post.

Ian @ un4seen

  • Administrator
  • Posts: 23889
Re: BASS for iOS (iPhone/iPad)
« Reply #1456 on: 23 Sep '21 - 15:14 »
The iOS version of the BASSmix 2.4.11 release is up in the 1st post.