20 Jun '13 - 10:11 *
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 ... 3 4 [5] 6 7 ... 37
  Reply  |  Print  
Author Topic: BASS for iOS (iPhone/iPad)  (Read 115671 times)
Renegade
Posts: 148


« Reply #80 on: 26 Aug '10 - 07:17 »
Reply with quoteQuote

@Bernd and Ian

Thanks for the answers.

Thanks for the pointer there Ian. I'll check into it. That's mostly what I need, as I am familiar with BASS, naturally. I just wanted to see some sample code that had SOMETHING familiar to me in it, i.e. BASS. It would make figuring out the other stuff infinitely easier as I'd have a familiar reference point. (So it's not so much that I need to know how BASS works, but that I need to figure out the platform.)

If anyone has anything to help alleviate my pain, please post a sample. I absolutely hate my Mac, through and through. I loathe even looking at it. And Xcode drives me into a twisted frenzy... Anything at all to help make me feel a tiny bit better about having to work on Apple platforms would be muchly appreciated.

Though I am thankful that it now appears Apple's hatred for Adobe is now more focused at Adobe and not at all non-Apple development tools, so MonoTouch is back on the table for iPhone development.

Sigh... Back to my Mac...  Cry
Logged
Ian @ un4seen
Administrator
Posts: 15366


« Reply #81 on: 26 Aug '10 - 13:20 »
Reply with quoteQuote

I am new here, so please help me !! I am an iPhone Developer and looking to port BASS inside my App. I downloaded the BASS for iPhone zip that you have given in the start of this thread, but I am lost as to how to really use it.I did link the libbass.a in my Link Binary with Libraries and build the empty project, it executed with no errors, but shows me nothing on the simulator. I just want to play around with the functionality of BASS intially and see what all it can do.

I'm afraid there are no examples for iPhone yet, but the BASS calls are the same on all platforms, so you could have a look at the OSX examples for some pointers. To begin with a simple playback test, you could add an audio file to your project's "Copy Bundle Resources" branch and do this (eg. in your "viewDidLoad" method) to play it...

BASS_Init(-1, 44100, 0, 0, 0); // initialize output device
NSString *respath=[[NSBundle mainBundle] pathForResource:@"filename" ofType:nil]; // get path of audio file
HSTREAM stream=BASS_StreamCreateFile(0, [respath UTF8String], 0, 0, BASS_SAMPLE_LOOP); // create a stream from it
BASS_ChannelPlay(stream, FALSE); // play the stream
Logged
coderGril
Posts: 2


« Reply #82 on: 31 Aug '10 - 04:40 »
Reply with quoteQuote

Thank you for your quick reply, but I am still in a fix. I downloaded the max osx version of bass and found the examples in there but I couldnt find the .xcodeproj to actually build the examples. I found makefiles along with the examples, but when I double click on the makefile it runs in the terminal and says command not found for everything.
Could you please explain me how to run the examples given in the mac osx version, I come from iPhone background and I am only familiar with xcode.

Also I tried the example you provided me, I created a new project added the link to libbass.a in my Link Binary with Libraries, created a view controller added the code you gave in its view did load but on building it gave me 5 errors, basically it cannot find anything BASS.

Please help me, I need to make an iPhone App for audio recording and playback but have never worked with audio before. Thank you again in advance.
Logged
Ian @ un4seen
Administrator
Posts: 15366


« Reply #83 on: 31 Aug '10 - 17:14 »
Reply with quoteQuote

Thank you for your quick reply, but I am still in a fix. I downloaded the max osx version of bass and found the examples in there but I couldnt find the .xcodeproj to actually build the examples. I found makefiles along with the examples, but when I double click on the makefile it runs in the terminal and says command not found for everything.
Could you please explain me how to run the examples given in the mac osx version, I come from iPhone background and I am only familiar with xcode.

I'll look into adding an XCode project to the package. In the meantime, the makefile can't be run itself, rather it is used with the "make" utility. To build the examples you can open a Terminal (from the Applications/Utilities folder), "cd" to the directory containing the makefile and then type "make".

Also I tried the example you provided me, I created a new project added the link to libbass.a in my Link Binary with Libraries, created a view controller added the code you gave in its view did load but on building it gave me 5 errors, basically it cannot find anything BASS.

Did you also #include "bass.h" in your source file? If so, and you still get the errors, please post the error messages to have a look at.
Logged
DrummerB
Posts: 18


« Reply #84 on: 26 Sep '10 - 00:09 »
Reply with quoteQuote

Hello,

I successfully set up BASS in a test iPhone project. Wasn't too difficult :-)
My problem is, that mp3 playback doesn't work as it should. I'm using the mp3-free library. I simply dropped a few song files into the project and tried to play them using BASS. m4a or caf works without any problem. However if I try to play an mp3 song, it only plays about half a second from the beginning and then stops. It doesn't crash and I wasn't able to get an error or something. If I swap the library with the normal (not mp3-free) version, it works. Does anyone have any idea what I could be doing wrong?
I simply opened a new project and added this to the viewDidLoad:
BASS_SetConfig(BASS_CONFIG_FLOATDSP, TRUE);
BASS_Init(-1, 44100, 0, NULL, NULL);
BASS_StreamFree(chan);
NSString *respath = [[NSBundle mainBundle] pathForResource:@"lips" ofType:@"mp3"];
chan = BASS_StreamCreateFile(0, [respath UTF8String], 0, 0, BASS_SAMPLE_LOOP);
BASS_ChannelPlay(chan, FALSE);
Logged
Ian @ un4seen
Administrator
Posts: 15366


« Reply #85 on: 27 Sep '10 - 13:37 »
Reply with quoteQuote

Do you happen to be using iOS 4.1? The MP3 decoder seems to have been modified and it no longer likes the way that BASS was feeding it data to decode. A BASS update to address that has been in testing for a couple of weeks, and it seems to be working fine, so that is now in the iOS package (see 1st post). Let me know if you still have any trouble with it.

Btw, the MP3 decoder also seems to be quite a bit faster now, presumably due to hardware acceleration. Which is nice Smiley
Logged
DrummerB
Posts: 18


« Reply #86 on: 27 Sep '10 - 16:22 »
Reply with quoteQuote

I'm indeed using iOS 4.1. The update fixed my problem. I simply swapped the libraries and it worked like a charm. Thank you very much, this is amazing!  Smiley
Logged
ppeau
Posts: 14


« Reply #87 on: 19 Oct '10 - 05:52 »
Reply with quoteQuote

Hello, I'm trying to include the bassFX on my BASS project on xcode but I get some troubles.
I got the FX header from the osx version and I put the FX library (iphone) with the bass library (iphone).

but I didn't catch the stuff :

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

If someone have sometimes to guide me on this set up Huh

Thank for the help and this is the error that I get


PS : I'm on SDK 4.2

Undefined symbols:
  "___cxa_pure_virtual", referenced from:
      __const@0 in libbass_fx.a(libbass_fx.a-armv6-master.o)
      __const@0 in libbass_fx.a(libbass_fx.a-armv6-master.o)
      __const@0 in libbass_fx.a(libbass_fx.a-armv6-master.o)
      __const_coal@0 in libbass_fx.a(libbass_fx.a-armv6-master.o)
      __const_coal@0 in libbass_fx.a(libbass_fx.a-armv6-master.o)
      __const_coal@0 in libbass_fx.a(libbass_fx.a-armv6-master.o)
      __const_coal@0 in libbass_fx.a(libbass_fx.a-armv6-master.o)
      __const_coal@0 in libbass_fx.a(libbass_fx.a-armv6-master.o)
      __const_coal@0 in libbass_fx.a(libbass_fx.a-armv6-master.o)
      __const_coal@0 in libbass_fx.a(libbass_fx.a-armv6-master.o)
      __const_coal@0 in libbass_fx.a(libbass_fx.a-armv6-master.o)
      __const_coal@0 in libbass_fx.a(libbass_fx.a-armv6-master.o)
  "operator new[](unsigned long)", referenced from:
      _BASS_FX_BPM_CallbackSet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
  "operator new(unsigned long)", referenced from:
      _BASS_FX_BPM_DecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_CallbackSet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_CallbackSet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_ReverseGetSource in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_ReverseGetSource in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_TempoCreate in libbass_fx.a(libbass_fx.a-armv6-master.o)
  "___cxa_guard_release", referenced from:
      _BASS_FX_BPM_CallbackSet in libbass_fx.a(libbass_fx.a-armv6-master.o)
  "operator delete[](void*)", referenced from:
      _BASS_FX_BPM_CallbackSet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_CallbackSet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_TempoGetRateRatio in libbass_fx.a(libbass_fx.a-armv6-master.o)
  "operator delete(void*)", referenced from:
      _BASS_FX_BPM_DecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_Free in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_Free in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_CallbackSet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_ReverseGetSource in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_ReverseGetSource in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-armv6-master.o)
      __textcoal_nt@0 in libbass_fx.a(libbass_fx.a-armv6-master.o)
      __textcoal_nt@0 in libbass_fx.a(libbass_fx.a-armv6-master.o)
  "___cxa_guard_acquire", referenced from:
      _BASS_FX_BPM_CallbackSet in libbass_fx.a(libbass_fx.a-armv6-master.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status

Logged
(: JOBnik! :)
Posts: 991


« Reply #88 on: 19 Oct '10 - 11:18 »
Reply with quoteQuote

Hi Grin

Quote
Since iPhone supports only static libraries, it isn't possible for static libraries to declare their dependencies,
so that needs to be done in the app's project instead, eg. by adding "-lstdc++" in the "Other Linker Flags".
Logged
ppeau
Posts: 14


« Reply #89 on: 19 Oct '10 - 15:57 »
Reply with quoteQuote

Thank a lot  JOBnik! , works like a charm  Cheesy
Logged
ppeau
Posts: 14


« Reply #90 on: 25 Oct '10 - 18:43 »
Reply with quoteQuote

HI , a new one for JOBnik! , I'm back with BASS_FX

bassStream = BASS_StreamCreateFile(0, [tmpURL UTF8String], 0, 0, 0);
NSLog(@"BASS_ErrorGetCode = %i", BASS_ErrorGetCode()); Return 0 and I can play it or whatever

But if I want to add :

bassStream = BASS_FX_ReverseCreate(bassStream, 2, BASS_STREAM_DECODE | BASS_FX_FREESOURCE );   
NSLog(@"BASS_ErrorGetCode = %i", BASS_ErrorGetCode()); Return 4000  Huh

I didn't use that stuff because I didn't catch if I have to use it for BASS_FX too :
Quote
extern void BASSFLACplugin, BASSWVplugin;
BASS_PluginLoad(&BASSFLACplugin, 0);
BASS_PluginLoad(&BASSWVplugin, 0);

Any idea ?
Logged
(: JOBnik! :)
Posts: 991


« Reply #91 on: 26 Oct '10 - 10:11 »
Reply with quoteQuote

Hi Grin

HI , a new one for JOBnik! , I'm back with BASS_FX

bassStream = BASS_StreamCreateFile(0, [tmpURL UTF8String], 0, 0, 0);
NSLog(@"BASS_ErrorGetCode = %i", BASS_ErrorGetCode()); Return 0 and I can play it or whatever

But if I want to add :

bassStream = BASS_FX_ReverseCreate(bassStream, 2, BASS_STREAM_DECODE | BASS_FX_FREESOURCE );   
NSLog(@"BASS_ErrorGetCode = %i", BASS_ErrorGetCode()); Return 4000  Huh

I didn't use that stuff because I didn't catch if I have to use it for BASS_FX too :
Quote
extern void BASSFLACplugin, BASSWVplugin;
BASS_PluginLoad(&BASSFLACplugin, 0);
BASS_PluginLoad(&BASSWVplugin, 0);

Any idea ?

Error code 4000 means "Not a decoding channel", i.e: you have to create a stream (BASS_StreamCreateFile) using the BASS_STREAM_DECODE flag and remove the BASS_STREAM_DECODE flag from BASS_FX_ReverseCreate function in case you don't want to decode it for e.g: creating a tempo stream as well Wink

You don't need to load BASS_FX using the BASS_PluginLoad function, as it's not a plugin.
Logged
c
Guest
« Reply #92 on: 26 Oct '10 - 23:24 »
Reply with quoteQuote

Hi,

I'm trying to decode two mp3 simultaneously on the iphone. I've tried using the 'mp3-free' version and the regular version of BASS. The 'mp3-free' version seems a little slower than the regular version when decoding two mp3's.

Is it correct that the regular bass library uses a pure software decoder, and the mp3-free version uses Apple APIs?

If so, do you mind sharing what apple APIs you use?

I'm looking for the fastest way to do this, and right now, it looks like it's decoding both mp3's with the regular BASS library.
I've tried using a few different apple APIs to see if I could possibly take advantage of hardware decoding, but none really seem to be faster.

I've tried AQOfflineRender with AudioQueue services, and also the ExtFileConvert stuff. But the next thing I will look at is AudioConverter.

I just need to squeeze a little more performance out so I can do two mp3's at about 1.5x real-time.

Any advice is appreciated,
-chris

Logged
DavidL
Posts: 4


« Reply #93 on: 23 Nov '10 - 21:49 »
Reply with quoteQuote

I'm recently upgraded from iOS SDK 4.1 to 4.2, and have started getting crashes.  I've been able to narrow things down to an iPad app made using one of Xcode's built-in templates and using BASS 2.4 [1] in a simple manner.

I can get the crash via an iPad app created by Xcode using the included "View-based Application" template.  After creating the app, if I add the iOS simulator-only libbass.a library to the target app and add the necessary #include path (to the OS X version of bass.h), everything's fine.  I can build and run the app in the simulator.  Once I add in a BASS_Init call [2], then rebuild and run the app, it will crash with the following error:

Attaching to process 23731.
Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
pthread_mutexattr_destroy$UNIX2003 called from function Huh in image BASS_Test_App.
If you are encountering this problem running a simulator binary within gdb, make sure you 'set start-with-shell off' first.

Program received signal:  “SIGABRT”.

Commenting out the BASS_Init call and rebuilding will allow the app to run again.

Setting 'start-with-shell' to off in gdb (via .gdbinit) does not make the crash go away.

Unfortunately, I've yet to be able to find out much info on this.  Some Google searches for "start-with-shell" and "iphone" turn up a variety of similar issues that people have been having in a variety of apps.  One post on the Apple Developer Forums [3] suggested, in regards to a similar problem, that recompiling libraries with iOS SDK 4.2 may fix things, however this was in response to a different function being used, and the poster wasn't 100% certain that it would work.

Anyways, just a heads up.  If I find out anything further, I can post it here.

-- David


[1] The copy of BASS 2.4 I'm using was downloaded from un4seen.com earlier today.

[2] Here are two BASS_Init calls I tried, both of which caused the app to crash:
- BASS_Init(-1, 44100, 0, 0, NULL);
- BASS_Init(0, 44100, 0, 0, NULL);

[3] Info on a similar looking problem error-wise, with suggestions on how to work around: https://devforums.apple.com/message/256360#256360
Logged
Ian @ un4seen
Administrator
Posts: 15366


« Reply #94 on: 24 Nov '10 - 16:49 »
Reply with quoteQuote

The current BASS builds were created with the iOS 4.1 SDK, which has added the "$UNIX2003" decoration/suffix to several functions in the simulator builds. The iOS 4.2 simulator apparently doesn't like that because those functions don't exist with the decoration on a real device, but device builds don't include the decoration anyway, so the error message does seem a bit unnecessary.

I will post rebuilds of BASS and the add-ons using the iOS 4.2 SDK (which doesn't add the "$UNIX2003" decoration) tomorrow.
Logged
DavidL
Posts: 4


« Reply #95 on: 24 Nov '10 - 17:19 »
Reply with quoteQuote

I will post rebuilds of BASS and the add-ons using the iOS 4.2 SDK (which doesn't add the "$UNIX2003" decoration) tomorrow.

Very cool.  Thanks much for your help!
Logged
Ian @ un4seen
Administrator
Posts: 15366


« Reply #96 on: 25 Nov '10 - 15:00 »
Reply with quoteQuote

The updated builds are now up in the 1st post. Let me know if you still have any trouble with them.
Logged
DavidL
Posts: 4


« Reply #97 on: 30 Nov '10 - 19:19 »
Reply with quoteQuote

The new build works great.  Thanks again!

-- David L.
Logged
MikaelS
Posts: 92


« Reply #98 on: 2 Dec '10 - 12:22 »
Reply with quoteQuote

I have found a problem with this most recent BASS release which breaks the most of my application. :|

I use BASS to stream files the following way:

NSString *theURL = [[NSString alloc] initWithFormat:@"http://192.168.0.199:8080/?method=database.getStream&id=%d", databaseID];
activeStream = BASS_StreamCreateURL([theURL UTF8String], 0, BASS_STREAM_STATUS | BASS_STREAM_AUTOFREE, &onDownload, NULL);

In the most recent release of BASS, the string sent to my WebService (the URL) gets mangled (only junk characters are sent).
I'm using the most recent XCode version and developing for iOS4.2.
The problem appears in both the simulator and when running on the device.

Please note that playing local files with BASSStreamCreateFile works well.


Thanks for any help, this is a bit urgent since it stops my applications main function. 
Logged
Ian @ un4seen
Administrator
Posts: 15366


« Reply #99 on: 2 Dec '10 - 13:21 »
Reply with quoteQuote

Oops! That problem was introduced along with the self-signed/invalid SSL certificate acceptance. A correction is now in the package (see 1st post). Let me know if you still have any problems with it.
Logged
Pages: 1 ... 3 4 [5] 6 7 ... 37
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines