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

Ian @ un4seen

  • Administrator
  • Posts: 20499
Re: BASS for iOS (iPhone/iPad)
« Reply #1225 on: 12 Jan '18 - 16:42 »
You can indeed change the device output rate via "setPreferredSampleRate", and BASS will pick that up and change its output accordingly (you can check the BASS_INFO "freq" value to confirm). You could change the mixer's rate to match via its BASS_ATTRIB_FREQ setting, but that will result in any already buffered data (in the mixer's playback buffer) being played at an incorrect rate, and will also bit a bit fiddly regarding source rates. So it would probably be best to recreate the mixer with the new rate (if you want to avoid resampling). You could also disable buffering via the mixer's BASS_ATTRIB_BUFFER setting a bit prior to changing the rate, so that there is no buffered data at the time of the rate change, and you can immediately stop the old mixer and start the new one.

puzzler

  • Posts: 10
Re: BASS for iOS (iPhone/iPad)
« Reply #1226 on: 17 Jan '18 - 17:48 »
Latest iOS bass version. Latest iOS version on iPhone 7.
1. run app and play some music/sounds
2. call to this phone
3. after call completed and focus returned to app - no any music/sounds at all

How to fix it? Or possible to fix it?

Ian @ un4seen

  • Administrator
  • Posts: 20499
Re: BASS for iOS (iPhone/iPad)
« Reply #1227 on: 18 Jan '18 - 17:40 »
Do you see any messages in the console when the problem happens? Are you requesting interruption notifications (eg. AVAudioSessionInterruptionNotification), and if so, do you get notified when the interruption begins and ends? If you aren't using your own interruption notifications, please try using the BASS_CONFIG_IOS_NOTIFY option and see if you receive notifications then, something like this:

Code: [Select]
BASS_SetConfigPtr(BASS_CONFIG_IOS_NOTIFY, IOSNotifyProc);

...

void IOSNotifyProc(DWORD status)
{
NSLog(@"IOSNotifyProc(%d)", status);
}

Also confirm whether you are using either of the BASS_CONFIG_IOS_MIXAUDIO or BASS_CONFIG_IOS_NOCATEGORY config options.

puzzler

  • Posts: 10
Re: BASS for iOS (iPhone/iPad)
« Reply #1228 on: 18 Jan '18 - 19:23 »
I use BASS_SetConfig(BASS_CONFIG_IOS_MIXAUDIO, 5), don't use any interruption notifications, don't use flag BASS_CONFIG_IOS_NOCATEGORY

After app gets focus I get error at console "AUIClient_StartIO failed (561015905)
test with notify returns "IOSNotifyProc(2)"

Ian @ un4seen

  • Administrator
  • Posts: 20499
Re: BASS for iOS (iPhone/iPad)
« Reply #1229 on: 19 Jan '18 - 14:48 »
OK. That looks like the same problem that another user reported with iOS 8 here:

   www.un4seen.com/forum/?topic=10910.msg116472#msg116472

The solution then was to delay the resumption (seems like the notification is received too soon). I will send you a debug BASS version to get some more info on what's happening there.

norbert

  • Posts: 126
Re: BASS for iOS (iPhone/iPad)
« Reply #1230 on: 20 Jan '18 - 10:46 »
Can't get a sample in a SFZ file loaded:

 BASS_MIDI_FontGetInfo  shows presets=1, samsize=0, samload=0, although I do a BASS_MIDI_FontLoad afterwards):

At runtime I create the sfz file with content:
Code: [Select]
<region>
sample=beat.wav

I've tried various other combinations for the sample path (absolute paths).

- The file beat.wav is located in the same folder as the sfz file (both in "Documents")
- The  file beat.wav actually  exists (tested with File.Exists())
-  Bass_GetError returns BASS_OK after each single call
- The same works on Android and there samload shows a value > 0 after BASS_MIDI_FontLoad

How should the path to a sample in a sfz file be specified in iOS ?