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

Ian @ un4seen

  • Administrator
  • Posts: 21991
Re: BASS for iOS (iPhone/iPad)
« Reply #1300 on: 29 Oct '18 - 16:55 »
What error code is the BASS_RecordStart call generating? Use BASS_ErrorGetCode immediately after to check that.

Ian @ un4seen

  • Administrator
  • Posts: 21991
Re: BASS for iOS (iPhone/iPad)
« Reply #1301 on: 30 Oct '18 - 17:13 »
The iOS version of the BASSOPUS 2.4.1.12 release is up now in the 1st post.

norbert

  • Posts: 133
Re: BASS for iOS (iPhone/iPad)
« Reply #1302 on: 4 Nov '18 - 17:17 »
Using BASS_ATTRIB_NOBUFFER option gave me super low latency playback  on my iPad  on iOS 10.x
Now I tested it again after serveral months running iOS 11 and there is a latency of about 400 ms.
No BASS errors and the BASS_SetAttribute returns true.
Updating to the latest BASS libs did not help. 
Any idea what could be the cause, the only difference seems to be the updated os version...?
 

Ian @ un4seen

  • Administrator
  • Posts: 21991
Re: BASS for iOS (iPhone/iPad)
« Reply #1303 on: 5 Nov '18 - 12:46 »
The BASS 2.4.13 release did introduce a bug to the BASS_ATTRIB_NOBUFFER option, which makes it behave opposite to how it should, ie. 1 = buffering, 0 = no buffering. That bug can be avoided by using the BASS_ATTRIB_BUFFER option instead, ie. setting that to 0 to disable buffering. The bug has been fixed for the 2.4.14 release, and I have now put the latest build up in the package in the 1st post. So you can re-download to get that.

Ian @ un4seen

  • Administrator
  • Posts: 21991
Re: BASS for iOS (iPhone/iPad)
« Reply #1304 on: 5 Nov '18 - 17:09 »
The iOS versions of the new BASSenc_MP3 and BASSenc_OPUS releases are now up in the 1st post.

Ian @ un4seen

  • Administrator
  • Posts: 21991
Re: BASS for iOS (iPhone/iPad)
« Reply #1305 on: 6 Nov '18 - 17:23 »
The iOS version of the BASSenc_FLAC 2.4.2 release is up now in the 1st post.

Ian @ un4seen

  • Administrator
  • Posts: 21991
Re: BASS for iOS (iPhone/iPad)
« Reply #1306 on: 9 Nov '18 - 17:40 »
The iOS version of the BASSMIDI 2.4.12 release is up now in the 1st post.

Ian @ un4seen

  • Administrator
  • Posts: 21991
Re: BASS for iOS (iPhone/iPad)
« Reply #1307 on: 17 Jan '19 - 16:37 »
The iOS version of the BASS 2.4.14 release is up now in the 1st post.

Viatiy

  • Posts: 1
Re: BASS for iOS (iPhone/iPad)
« Reply #1308 on: 25 Feb '19 - 14:47 »
Hello!
Sorry for my stupid question, but how do I connect Bass to a Swift project?

Ian @ un4seen

  • Administrator
  • Posts: 21991
Re: BASS for iOS (iPhone/iPad)
« Reply #1309 on: 26 Feb '19 - 16:04 »
I'm not a Swift user myself, so I'm afraid I'm unable to advise on the specifics of that, but perhaps this will help you get started:

   https://github.com/Starling-Inc/Bass

Ian @ un4seen

  • Administrator
  • Posts: 21991
Re: BASS for iOS (iPhone/iPad)
« Reply #1310 on: 13 Mar '19 - 14:03 »
The iOS version of the BASSHLS 2.4.2 release is up now in the 1st post.

Ian @ un4seen

  • Administrator
  • Posts: 21991
Re: BASS for iOS (iPhone/iPad)
« Reply #1311 on: 28 Mar '19 - 12:56 »
There was a bug in the recent BASSmix 2.4.9.8 update that could result in a mixer source being muted after calling BASS_Mixer_ChannelSetPosition on it. Another update (2.4.9.9) is up now in the 1st post to fix that. The 2.4.9.8 update was only posted for iOS and Android, so other platforms are unaffected.

JustinJMNet

  • Posts: 2
Re: BASS for iOS (iPhone/iPad)
« Reply #1312 on: 9 Apr '19 - 13:53 »
Hi, trying to get a simple MIDI Player working in iOS/Objective-C with the BASSMIDI library similar to the Android MIDITest.java example provided in the Android version of the BASS library. 

I'm seeing that the MIDI file is getting a handle/channel number so it appears to be loading successfully.  I just don't get any audio (Audio works fine when playing an MP3)

Here's the code - again runs but getting no audio. 

Code: [Select]
- (BOOL)loadMIDIWithURL:(NSURL *)url autoPlay:(BOOL)autoplay
{
    [self.audioSession setCategory:AVAudioSessionCategoryPlayback error: nil];
    [self.audioSession setActive:YES error:nil];
   

    //Stop channel;
    BASS_ChannelStop(_channel);
   
    //Free memory
    BASS_StreamFree(_channel);
   
    _channel = BASS_MIDI_StreamCreateFile(false, [[url path] cStringUsingEncoding:NSUTF8StringEncoding], 0, 0 ,0, 0);
   
    //Set callback
    BASS_ChannelSetSync(_channel, BASS_SYNC_END, 0, ChannelEndedCallback, (__bridge void *)self);
   
    if(!BASS_MIDI_StreamEvent(_channel, 0, 9, 16363)){
        // an error occured
    };
   
    /* Play if needed */
    if (autoplay) {
        [self play];
    }
   
    int code = BASS_ErrorGetCode();
    return code == 0;
}

Started with https://github.com/Alterplay/APAudioPlayer  and attempted to add the BASSMIDI types and methods to the bass.h header file - based on what is in the Android Library. 

Any help pointing out what I'm missing here is greatly appreciated!  :)
« Last Edit: 9 Apr '19 - 14:16 by JustinJMNet »

Ian @ un4seen

  • Administrator
  • Posts: 21991
Re: BASS for iOS (iPhone/iPad)
« Reply #1313 on: 9 Apr '19 - 17:58 »
An SF2 soundfont (or SFZ) is needed to provide the instrument sounds for BASSMIDI to play. If you don't already have one, a couple are available from the BASS webpage (next to the BASSMIDI download). If you will be using a single soundfont in your app, you can activate it via the BASS_CONFIG_MIDI_DEFFONT option, something like this:

Code: [Select]
BASS_SetConfigPtr(BASS_CONFIG_MIDI_DEFFONT, [[[NSBundle mainBundle] pathForResource:@"soundfont.sf2" ofType:nil] UTF8String]);

BASS_MIDI_FontInit and BASS_MIDI_StreamSetFonts can be used for more complex soundfont arrangements.

JustinJMNet

  • Posts: 2
Re: BASS for iOS (iPhone/iPad)
« Reply #1314 on: 9 Apr '19 - 18:29 »
Yep, looks like I was missing the sound font on init.  MIDI Audio is now working for me.  Thank you!

sergiou87

  • Posts: 1
Re: BASS for iOS (iPhone/iPad)
« Reply #1315 on: 3 May '19 - 23:25 »
Hello!

I've noticed a weird regression in BASS Mix. I'm doing fade out effect on pause and then fade in on resume, and it worked perfectly so far with BASS Mix version 2.4.9.0, until recently I updated it.

The code I use is this:
Code: [Select]
  BASS_MIXER_NODE nodes[2];
  nodes[0].pos = 0;
  nodes[0].value = 0;
  nodes[1].pos = BASS_ChannelSeconds2Bytes(m_resampler, 0.2);
  nodes[1].value = 1;

  BASS_Mixer_ChannelSetSync(m_resampler, BASS_SYNC_MIXER_ENVELOPE | BASS_SYNC_ONETIME, 0, OnChannelResumed, this);
  BASS_Mixer_ChannelSetEnvelope(m_resampler, BASS_MIXER_ENV_VOL, nodes, 2);

I've tested upgrading BASS Mix to both 2.4.9.8 and 2.4.9.9 versions (keeping the rest of libraries the same) and I get this unexpected behavior:
- on fade out for pause, I can notice how the right channel suddenly stops while the left channel fades out nicely as expected.
- after that, I cannot "resume" playback. Or actually, I do resume playback but volume is stuck at 0.

And these might be interesting data points while I tried to workaround the issue:
- if I force the volume back to 1 on resume (before the fade in envelope), the fade in effect works... but only on the left speaker, the right speaker is still mute for the rest of the playback session.
- if I force pan=right during the whole playback session (I just wanted to know how broken it was), I notice how playback abruptly switches to the left speaker during the fade in and fade out effects, and then back to the right speaker as I enforced.

As mentioned before, if I go back to version 2.4.9.0 everything works great again.

I hope this info helps you fix the bug. If you need more info, I'm more than happy to help resolving it.

Ian @ un4seen

  • Administrator
  • Posts: 21991
Re: BASS for iOS (iPhone/iPad)
« Reply #1316 on: 8 May '19 - 13:26 »
Oops! A tweak in BASSmix 2.4.9.8 did indeed introduce a problem to the envelope processing. A BASSmix update to fix that is up now in the 1st post. The Android version was also affected, so an update is up in the Android thread too.

Ian @ un4seen

  • Administrator
  • Posts: 21991
Re: BASS for iOS (iPhone/iPad)
« Reply #1317 on: 9 Aug '19 - 16:13 »
The iOS version of the new BASSWEBM add-on is up now in the 1st post.