21 May '13 - 21:06 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1] 2 3 ... 36
  Reply  |  Print  
Author Topic: BASS for iOS (iPhone/iPad)  (Read 109765 times)
Ian @ un4seen
Administrator
Posts: 15259


« on: 16 Feb '10 - 16:32 »
Reply with quoteQuote

iOS versions of BASS and the BASSFLAC/MIDI/OPUS/WV/enc/mix add-ons are available here:

   www.un4seen.com/stuff/bass24-iphone.zip (updated: 3 May '13)

The headers and documentation can be taken from the packages on the BASS page. The examples haven't been ported yet, but the BASS calls will be the same as on other platforms. If anyone would like to port any of the examples, that would be very welcome Smiley

The BASS_APE/FX/MPC add-ons are also available:

   www.un4seen.com/stuff/bass_ape-iphone.zip
   www.un4seen.com/stuff/bass_mpc-iphone.zip
   www.un4seen.com/files/z/0/bass_fx24-iphone.zip

Note that BASS and the add-ons are provided as static libraries, because dynamic libraries aren't allowed on the iPhone. Both "device" (armv6/armv7/armv7s) and "simulator" builds are supported (the linker will extract the appropriate code from the libraries). To include BASS in your project, the LIBBASS.A file should be added to the "Link Binary With Libraries" branch. You will also need to add the following frameworks to the project: AudioToolbox, SystemConfiguration, CFNetwork, Accelerate, CoreMIDI (if using BASSMIDI). The "Other Linker Flags" setting should also include "-lstdc++" when using BASS_FX or BASS_APE.

An "mp3-free" version (using the OS's MP3 decoder) is also included. Note that requires iOS 3 or above; it will run on earlier versions but MP3 support won't be available.

The plugin system is supported, but a little differently due to the lack of dynamic libraries. For example, if you want to load BASSFLAC and BASSWV as plugins, you can do so like this (after adding LIBBASSFLAC.A and LIBBASSWV.A to your project)...

extern void BASSFLACplugin, BASSWVplugin;
BASS_PluginLoad(&BASSFLACplugin, 0);
BASS_PluginLoad(&BASSWVplugin, 0);

There are also a few iOS-specific "audio session" BASS_SetConfig/Ptr options...

BASS_CONFIG_IOS_MIXAUDIO can be set to a combination of the following flags/bits: 1 = allow other audio to mix with the app's audio (enables kAudioSessionProperty_OverrideCategoryMixWithOthers), 2 = also "duck" the other audio (enables kAudioSessionProperty_OtherMixableAudioShouldDuck), 4 = use the "ambient" category (enables kAudioSessionCategory_SoloAmbientSound/AmbientSound instead of kAudioSessionCategory_MediaPlayback). The default setting is 1.

BASS_CONFIG_IOS_SPEAKER, when set to 1, sends the output to the speaker instead of the receiver (enables kAudioSessionProperty_OverrideCategoryDefaultToSpeaker). The default setting is 0 (off).

BASS_CONFIG_IOS_NOTIFY can be used to set a callback function (IOSNOTIFYPROC) to receive interruption notifications from BASS's AudioSessionInterruptionListener.

When using AAC encoding (via BASS_Encode_StartCA), BASS_CONFIG_IOS_MIXAUDIO needs to be set to 0.

Support for use with .Net is included in the BASS.Net package.

Note: The output volume level was 6dB lower than on other platforms prior to version 2.4.8.10. If upgrading from an older version and you find that the level is now higher than wanted, the BASS_CONFIG_GVOL config options can be used to compensate.
« Last Edit: 3 May '13 - 17:30 by Ian @ un4seen » Logged
ken
Posts: 630


« Reply #1 on: 16 Feb '10 - 18:01 »
Reply with quoteQuote

In there is any C# coders that use MonoTouch framework for developing iPhone apps, I'm happy to tell you that BASS for IPhone works with MonoTouch (yes you can link static libraries in MonoTouch). I can make a simple MonoTouch example if needed.

/Ken
Logged
ReymonARG
Posts: 41


« Reply #2 on: 16 Feb '10 - 19:03 »
Reply with quoteQuote

Nice Job, Next for BlackberryOS  Wink
Logged
ken
Posts: 630


« Reply #3 on: 16 Feb '10 - 20:15 »
Reply with quoteQuote

Nice Job, Next for BlackberryOS  Wink

Don't forget Android...
Logged
radio42
Posts: 4012


« Reply #4 on: 16 Feb '10 - 20:20 »
Reply with quoteQuote

A Bass.Net version for iPhone is comming soon...
Logged
StuC
Guest
« Reply #5 on: 17 Feb '10 - 15:51 »
Reply with quoteQuote


What the Licensing/Cost  of the iPhone version ?


Logged
Ian @ un4seen
Administrator
Posts: 15259


« Reply #6 on: 17 Feb '10 - 16:59 »
Reply with quoteQuote

Licensing is the same on all of the supported platforms. In the case of the Shareware licence, an amendment has been made primarily with the iPhone App Store in mind, whereby the product doesn't actually have to be shareware (eg. "try before you buy") but the price limit is lowered to 10 Euros then.
Logged
NeoStrider
Posts: 3


« Reply #7 on: 23 Mar '10 - 22:00 »
Reply with quoteQuote

I'm having a few issues with a adaptation of the net-radio example.
I`ve successfully adapted it to iPhone and it works fine on the simulator, but I cant seem to build it for the devices. Here is my error log:

ld: warning: in /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwork.framework/CFNetwork, missing required architecture arm in file
Undefined symbols:
  "_kCFStreamPropertyFTPFileTransferOffset", referenced from:
      _kCFStreamPropertyFTPFileTransferOffset$non_lazy_ptr in libbass.a(bass.o)
  "_kCFStreamPropertyHTTPShouldAutoredirect", referenced from:
      _kCFStreamPropertyHTTPShouldAutoredirect$non_lazy_ptr in libbass.a(bass.o)
  "_CFHTTPMessageAddAuthentication", referenced from:
      _BASS_RecordGetInputName in libbass.a(bass.o)
      _BASS_RecordGetInputName in libbass.a(bass.o)
  "_CFHTTPMessageCreateRequest", referenced from:
      _BASS_RecordGetInputName in libbass.a(bass.o)
  "_kCFStreamPropertyFTPFetchResourceInfo", referenced from:
      _kCFStreamPropertyFTPFetchResourceInfo$non_lazy_ptr in libbass.a(bass.o)
  "_kCFStreamPropertyFTPResourceSize", referenced from:
      _kCFStreamPropertyFTPResourceSize$non_lazy_ptr in libbass.a(bass.o)
  "_CFReadStreamCreateWithFTPURL", referenced from:
      _BASS_RecordGetInputName in libbass.a(bass.o)
  "_kCFStreamPropertyHTTPResponseHeader", referenced from:
      _kCFStreamPropertyHTTPResponseHeader$non_lazy_ptr in libbass.a(bass.o)
  "_kCFHTTPAuthenticationSchemeBasic", referenced from:
      _kCFHTTPAuthenticationSchemeBasic$non_lazy_ptr in libbass.a(bass.o)
  "_kCFStreamPropertyFTPUsePassiveMode", referenced from:
      _kCFStreamPropertyFTPUsePassiveMode$non_lazy_ptr in libbass.a(bass.o)
  "_CFHTTPMessageCopySerializedMessage", referenced from:
      _BASS_RecordGetInputName in libbass.a(bass.o)
  "_kCFHTTPVersion1_1", referenced from:
      _kCFHTTPVersion1_1$non_lazy_ptr in libbass.a(bass.o)
  "_CFReadStreamCreateForHTTPRequest", referenced from:
      _BASS_RecordGetInputName in libbass.a(bass.o)
  "_kCFStreamPropertyFTPProxy", referenced from:
      _kCFStreamPropertyFTPProxy$non_lazy_ptr in libbass.a(bass.o)
  "_kCFStreamPropertyHTTPProxy", referenced from:
      _kCFStreamPropertyHTTPProxy$non_lazy_ptr in libbass.a(bass.o)
  "_CFHTTPMessageSetHeaderFieldValue", referenced from:
      _BASS_RecordGetInputName in libbass.a(bass.o)
      _BASS_RecordGetInputName in libbass.a(bass.o)
      _BASS_RecordGetInputName in libbass.a(bass.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status

I really need this working ASAP, for a commercial project, please. BASS looks impressive and solved in hours what days of OGG ramblings couldn't help.
Have you guys used stuff only available in CoreServices?
Logged
Ian @ un4seen
Administrator
Posts: 15259


« Reply #8 on: 24 Mar '10 - 16:17 »
Reply with quoteQuote

That looks like it is linking with the wrong library version, eg. the "simulator" BASS when you're building a "device" application. I think the simplest way to avoid that problem is to just add both BASS library versions to the project.

edit: Actually, looking at it again (more closely this time!), that looks like it is linking with the wrong CFNetwork framework version, ie. the OSX version rather than the iPhone version? You could try removing that from the project, and then adding it again, eg. right-click on the project, select "Get Info", click the "+" button below the "Linked Libraries" list, and select "CFNetwork" from the list of frameworks.
« Last Edit: 24 Mar '10 - 17:43 by Ian @ un4seen » Logged
NeoStrider
Posts: 3


« Reply #9 on: 24 Mar '10 - 18:07 »
Reply with quoteQuote

Nevermind...it was XCode fault...again...
Got everything working very well here.
Now is time to evaluate the licenses...
Thanks!
Logged
Bert
Posts: 159


« Reply #10 on: 26 Mar '10 - 16:32 »
Reply with quoteQuote

Do you want to share your working example with us?

Would be very nice!
Logged
NeoStrider
Posts: 3


« Reply #11 on: 26 Mar '10 - 16:35 »
Reply with quoteQuote

Its surprisingly the same as the macosx radio player. The only problem was removing the callbacks and handlers from Carbon Stuff. I still need to write a proper buffer manager, and then I promisse to give back to you something...
Logged
rdalton
Posts: 5


« Reply #12 on: 6 Apr '10 - 04:45 »
Reply with quoteQuote

Hi Ian,

The iPhone port is much appreciated.  Nice work!  I was just wondering if you are using the Tremor decoder (fixed-point Ogg decoder)?  If not, are there any plans to incorporate it sometime soon?

Thanks.

Robert
Logged
atatum1
Guest
« Reply #13 on: 6 Apr '10 - 11:50 »
Reply with quoteQuote

Is there a blackberry version as well please?
Logged
hippocoder
Posts: 14


« Reply #14 on: 6 Apr '10 - 14:30 »
Reply with quoteQuote

Does this work with the iPad?
« Last Edit: 6 Apr '10 - 15:16 by hippocoder » Logged
Bert
Posts: 159


« Reply #15 on: 6 Apr '10 - 15:37 »
Reply with quoteQuote

Yes, i think it's working on the ipad.
Logged
hippocoder
Posts: 14


« Reply #16 on: 6 Apr '10 - 15:38 »
Reply with quoteQuote

Brilliant!

I want to deploy to windows, mac, iphone and ipad. I do have plans to use android and windows mobile but I think I will just have to recode those bits (bite the bullet) so to speak.
Logged
Ian @ un4seen
Administrator
Posts: 15259


« Reply #17 on: 6 Apr '10 - 15:51 »
Reply with quoteQuote

I was just wondering if you are using the Tremor decoder (fixed-point Ogg decoder)?  If not, are there any plans to incorporate it sometime soon?

The fixed-point OGG decoder is used in the WinCE version of BASS, but not the iPhone version, as the iPhone does have an FPU. I don't remember the numbers now, but I seem to recall finding that the fixed-point decoder wasn't faster on the iPhone.

Is there a blackberry version as well please?

I'm afraid there aren't any plans for that at the moment, but who knows in the future Smiley
Logged
sui
Guest
« Reply #18 on: 22 Apr '10 - 14:19 »
Reply with quoteQuote

Hi everybody,

I tried BASS for my iPhone application. It works very well but I have a problem...
When my iPhone locks screen, there is no more sound. I read Apple documentation, it seems that I should setup Audio sessions and set the AVAudioSessionCategoryPlayback category. But it has no effect.

Has anyone got this issue ?

Thanks a lot !
Logged
ken
Posts: 630


« Reply #19 on: 22 Apr '10 - 17:40 »
Reply with quoteQuote

Hi everybody,

I tried BASS for my iPhone application. It works very well but I have a problem...
When my iPhone locks screen, there is no more sound. I read Apple documentation, it seems that I should setup Audio sessions and set the AVAudioSessionCategoryPlayback category. But it has no effect.

Has anyone got this issue ?

Thanks a lot !

Try this code:

AudioSession.Category = AudioSessionCategory.MediaPlayback
Logged
Pages: [1] 2 3 ... 36
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines