|
MikaelS
Posts: 92
|
 |
« Reply #100 on: 2 Dec '10 - 13:38 » |
Quote
|
Thanks for the quick fix Ian! It seems to work fine (I have only been able to test it in the simulator so far, more tests will follow). If some problem remains, I will report it here.
Thanks once again!
|
|
|
|
|
Logged
|
|
|
|
|
hudbrog
Posts: 3
|
 |
« Reply #101 on: 26 Dec '10 - 20:14 » |
Quote
|
Hi! I'm kinda new to the whole BASS thing. Just wrote a sample application for iphone, which records sound from mic, applies some effects and plays it back. Now I'm wondering, is there a simple way to save my stream to file? To some format known to iOS, like caf or something?
|
|
|
|
|
Logged
|
|
|
|
|
Ian @ un4seen
Administrator
Posts: 15352
|
 |
« Reply #102 on: 27 Dec '10 - 15:53 » |
Quote
|
The next BASSenc release will include support for CoreAudio codecs on OSX and iOS. If you would like to try it now, the current build has been added to the iOS package (see 1st post). An updated BASSENC.H header is provided, which includes a BASS_Encode_StartCAFile function that accepts a file type (kAudioFileXXX), audio type (kAudioFormatXXX), and output filename. It also accepts a bitrate (bits per second), but that only applies to lossy formats like AAC (use "0" for the default bitrate). For example, to create an ALAC M4A file, you could do this... BASS_Encode_StartCAFile(handle, 'm4af', 'alac', 0, 0, filename);
Or for an IMA4/ADPCM CAF file... BASS_Encode_StartCAFile(handle, 'caff', 'ima4', 0, 0, filename);
The "flags" parameter accepts BASS_ENCODE_FP_xxx, BASS_ENCODE_PAUSE, BASS_ENCODE_AUTOFREE, BASS_UNICODE, and a new BASS_ENCODE_MONO flag to convert the source data to mono (if it isn't already). Use BASS_Encode_Stop to close the encoder/file.
|
|
|
|
|
Logged
|
|
|
|
|
ken
Posts: 630
|
 |
« Reply #103 on: 27 Dec '10 - 16:42 » |
Quote
|
The next BASSenc release will include support for CoreAudio codecs on OSX and iOS. Now that is a welcomed feature. Ian, will it possible to encode to a IceCastServer ? /Ken
|
|
|
|
|
Logged
|
|
|
|
|
hudbrog
Posts: 3
|
 |
« Reply #104 on: 27 Dec '10 - 20:36 » |
Quote
|
Thanks Ian, worked like a charm. Now I have another problem. When I tested a sample I mentioned before on simulator - everything worked great. But after I've installed it on iphone - volume of the sound is really low. I've tried setting BASS_ChannelSetAttribute(chan, BASS_ATTRIB_VOL, 1.0f); and just BASS_SetVolume(1.0f); but nothing changed. Is there any way I could increase volume?
After some investigation - that only applies when I record something in the same time. I.e. right now i have a recording channel, and a push stream, to which I push loud enough data. When I play data directly from that stream while still recording - volume is low. If I just create a stream from the recording I've encoded with bassenc before(case #1 above) and play- volume is ok.
|
|
|
|
|
Logged
|
|
|
|
|
hudbrog
Posts: 3
|
 |
« Reply #105 on: 28 Dec '10 - 17:44 » |
Quote
|
Just as an addition. This behavior is actually reproduced with native iPhone SDK, to get rid of it you just need to fire something like: UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker; AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute, sizeof(audioRouteOverride),&audioRouteOverride); You get some artefacts when using headphones thou...
|
|
|
|
|
Logged
|
|
|
|
|
Ian @ un4seen
Administrator
Posts: 15352
|
 |
« Reply #106 on: 30 Dec '10 - 16:15 » |
Quote
|
Now that is a welcomed feature. Ian, will it possible to encode to a IceCastServer ?
That isn't possible with the current build, but it is something that I will be looking into.
|
|
|
|
|
Logged
|
|
|
|
|
keyClipse
Posts: 4
|
 |
« Reply #107 on: 5 Jan '11 - 19:58 » |
Quote
|
Hi everyone, I have a problem in adding the plugin BASSMIX for iphone this is the error that I have got "_BASSMIXplugin", referenced from: _BASSMIXplugin$non_lazy_ptr in testBASSViewController.o (maybe you meant: _BASSMIXplugin$non_lazy_ptr) ld: symbol(s) not found collect2: ld returned 1 exit status I have followed the first post instruction so I am wondering where I have gone wrong...
|
|
|
|
|
Logged
|
|
|
|
|
Ian @ un4seen
Administrator
Posts: 15352
|
 |
« Reply #108 on: 6 Jan '11 - 17:22 » |
Quote
|
BASSmix isn't a plugin in the sense that BASSFLAC/etc is, ie. it can't be loaded via BASS_PluginLoad as it doesn't add support for additional file formats. To use the BASSmix functions in your app you just need to add the LIBBASSMIX.A file to your project.
|
|
|
|
|
Logged
|
|
|
|
|
DrummerB
Posts: 18
|
 |
« Reply #109 on: 11 Jan '11 - 17:06 » |
Quote
|
Hi, Does anyone know how to get the multitask remote controls to work with BASS?  Making BASS work in the background wasn't a problem, one simply has to add a key to the Info.plist file. However there are apps (Pandora) that can be controlled using the playback control buttons in the multitask bar, when they're in the background. I figured out that, if the app plays music using AVAudioPlayer, it's icon will automatically replace the iPod icon and it can subscribe to be notified when the user taps a button. However, I wasn't able to do the same thing with BASS. Here are some examples, demonstrating this feature: http://cl.ly/2af24504d26441d7f7ffhttps://developer.apple.com/library/ios/#samplecode/MixerHost/Introduction/Intro.html
|
|
|
|
|
Logged
|
|
|
|
|
ken
Posts: 630
|
 |
« Reply #110 on: 12 Jan '11 - 08:43 » |
Quote
|
Hi,
Does anyone know how to get the multitask remote controls to work with BASS?
I'm looking for the same solution, also get the blue "play icon" in taskbar to show when running BASS. I think there is some events for the "remote controls" that can be subscribed to. I do use .NET and monotouch but the principle is the same.
|
|
|
|
|
Logged
|
|
|
|
|
DrummerB
Posts: 18
|
 |
« Reply #111 on: 12 Jan '11 - 13:52 » |
Quote
|
Yes, you have to call [[UIApplication sharedApplication] beginReceivingRemoteControlEvents]; or something like that and implement the method - (void) remoteControlReceivedWithEvent: (UIEvent *) receivedEvent to handle those events. This works with AVAudioPlayer, but not with BASS. I guess Apple's audio frameworks have some hidden mechanism built in to notify the system that the app started playing music. One could probably fake some playback using an AVAudiPlayer and setting volume to 0, but that wouldn't be a very elegant solution. I think the blue play icon will automatically be added to the status bar as soon as you were able to successfully set up the remote control buttons (those in the multitask bar).
|
|
|
|
|
Logged
|
|
|
|
|
Ian @ un4seen
Administrator
Posts: 15352
|
 |
« Reply #112 on: 12 Jan '11 - 16:50 » |
Quote
|
This came up before (off forum). As I recall, the enabling of kAudioSessionProperty_OverrideCategoryMixWithOthers (which allows the app's and device's audio to play together) was disabling the remote control events. To avoid that, kAudioSessionProperty_OverrideCategoryMixWithOthers can be disabled like this (before the BASS_Init call)... #define BASS_CONFIG_IOS_MIXAUDIO 34 BASS_SetConfig(BASS_CONFIG_IOS_MIXAUDIO, 0); // disable mixing
Let me know if it is still not working properly after that.
|
|
|
|
|
Logged
|
|
|
|
|
DrummerB
Posts: 18
|
 |
« Reply #113 on: 12 Jan '11 - 18:11 » |
Quote
|
Thanks a lot Ian! That solved the problem. I read about that property somewhere and I tried to disable it, but didn't know BASS could do it. The only remaining issue is, that when the user taps the pause button, I have to pause the music using BASS_Pause(), because only pausing the single channel I'm using isn't enough. The audio frameworks must think BASS is still playing something, because the even though the channel is paused, the pause button doesn't turn into a play button and the little play icon in the status bar doesn't disappear. But I'm glad I found a workaround. I'll probably post a sample project about this, when I have some time.
|
|
|
|
|
Logged
|
|
|
|
|
DrummerB
Posts: 18
|
 |
« Reply #114 on: 12 Jan '11 - 22:53 » |
Quote
|
Okay, here is a sample app, demonstrating how to make BASS play back music in the background, and control playback with the multitask bar controls. Actually the app can also be remote controlled with some 3rd party iPhone accessories and speakers. http://cl.ly/4513342M223M3v0s2Y3T
|
|
|
|
|
Logged
|
|
|
|
|
Ian @ un4seen
Administrator
Posts: 15352
|
 |
« Reply #115 on: 13 Jan '11 - 17:43 » |
Quote
|
The next BASSenc release will include support for CoreAudio codecs on OSX and iOS. Now that is a welcomed feature. Ian, will it possible to encode to a IceCastServer ? An updated build with that capability is now up in the package (see 1st post). You could use it something like this... HENCODE encoder=BASS_Encode_StartCA(source, 'adts', 'aac ', 0, bitrate*1000, 0, 0); // start an AAC encoder BASS_Encode_CastInit(encoder, server, password, BASS_ENCODE_TYPE_AAC, name, url, genre, desc, headers, bitrate, 0); // connect it to the cast server
Note the only useful codec for this purpose included in iOS is AAC, eg. there is no MP3 encoder (only decoder). Also note the BASS_CONFIG_IOS_MIXAUDIO option (mentioned a few posts above) needs to be set to 0 before BASS_Init or BASS_RecordInit is called, to allow AAC encoding. It seems to be working quite nicely, but it hasn't been tested very much yet, so please report how you get on. Thanks a lot Ian! That solved the problem. I read about that property somewhere and I tried to disable it, but didn't know BASS could do it.
Good to hear it worked. As I recall, the remote stuff won't work if the "MixWithOthers" option has been enabled at all, so that would probably be why it still didn't work after you disabled that (BASS had enabled it). The BASS_CONFIG_IOS_MIXAUDIO option was added as a workaround, but was left undocumented in case it got superseded by other session-related option(s). It has since been found to be needed for AAC encoding too, so it will probably become documented in the next update. The only remaining issue is, that when the user taps the pause button, I have to pause the music using BASS_Pause(), because only pausing the single channel I'm using isn't enough. The audio frameworks must think BASS is still playing something, because the even though the channel is paused, the pause button doesn't turn into a play button and the little play icon in the status bar doesn't disappear. But I'm glad I found a workaround.
Yep, BASS_Pause entirely stops the output (assuming the BASS_CONFIG_PAUSE_NOPLAY option hasn't been turned off). Without that (or BASS_Stop), BASS will still be outputing silence when there are no channels playing. Okay, here is a sample app, demonstrating how to make BASS play back music in the background, and control playback with the multitask bar controls. Actually the app can also be remote controlled with some 3rd party iPhone accessories and speakers. http://cl.ly/4513342M223M3v0s2Y3TNice 
|
|
|
|
|
Logged
|
|
|
|
|
Dustin
Posts: 1
|
 |
« Reply #116 on: 17 Jan '11 - 23:39 » |
Quote
|
I am glad to hear from Ken that we will be able to use Mono.
I have only one question, is it possible to encode with the EncoderOgg format on the iOS platform?
Basically I am looking for a single codec to use on multiple platforms that is not MP3 for voice recording and playback.
|
|
|
|
|
Logged
|
|
|
|
|
matt1980
Posts: 5
|
 |
« Reply #117 on: 18 Jan '11 - 02:03 » |
Quote
|
Hi there...having two problems with BASS in an iPad app, with the latest version I downloaded today from the top of this thread... The first is the biggie: I just downloaded the latest zip file from the updated link in the original post. As near as I can tell, these don't have armv7 object code in them. At first, Xcode was complaining that: ignoring file /[...]/libbass.a, file was built for archive which is not the architecture being linked (armv7) ignoring file /[...]/bassmidi/libbassmidi.a, file was built for archive which is not the architecture being linked (armv7) Which baffled me for a while, but then I tried using ar -x on the .a files and I got bass.o and libbassmidi.a-armv6-master.o. After I added these to my project as frameworks, I got this instead: ignoring file /[...]/bass.o, file was built for armv6 which is not the architecture being linked (armv7) ignoring file /[...]/bassmidi/libbassmidi.a-armv6-master.o, file was built for armv6 which is not the architecture being linked (armv7) I might be able to compile this as armv6 (I haven't tried) but I'm supposed to make iPad apps at least armv6/armv7, if not strictly armv7, I think. I didn't have this problem with the version of the library I picked up about a year ago...which I overwrote when I copied the new ones in  . However it could be I'm just lost--I'm not an expert at this build stuff. I am using the 4.3 beta version at the moment, but I'm thinking that's not the problem. The second problem is preventing me from testing in the simulator--it crashes on launch, and I get the following in the log: Detected an attempt to call a symbol in system libraries that is not present on the iPhone: pthread_mutexattr_destroy$UNIX2003 called from function ??? in image LineSpace. And according to the stack in the debugger this comes within BASS_RecordGetInputName. I've actually been having this one for a while, since I got an updated copy of the library somewhere in the neighborhood of six months ago, perhaps--at about the same time I switched to iOS 4.x as my target, so this could have something to do with it as well. I can test on my iPad, so it hasn't been a show-stopper. But it hasn't gone away either. It would be nice to be able to use the simulator again. Thanks, all in all a very nice library! -Matt
|
|
|
|
|
Logged
|
|
|
|
|
Ian @ un4seen
Administrator
Posts: 15352
|
 |
« Reply #118 on: 18 Jan '11 - 16:25 » |
Quote
|
I have only one question, is it possible to encode with the EncoderOgg format on the iOS platform?
Basically I am looking for a single codec to use on multiple platforms that is not MP3 for voice recording and playback.
The EncoderOgg class uses the external OGGENC encoder, but external executables are not permitted on the iOS platform, so I'm afraid that option would not be available. I'm not sure what the performance would be like, but a possible solution would be to build the OGG encoding (libvorbis/etc) into your app. The formats that iOS includes built-in encoding support for are AAC, ALAC (Apple Lossless), iLBC (internet Low Bitrate Codec for speech), IMA4 (ADPCM), µ-law and a-law. They are accessible via BASSenc's BASS_Encode_StartCA/File functions. having two problems with BASS in an iPad app...
The BASS libraries should include both armv6 and armv7 flavours. From the 2nd problem (pthread_mutexattr_destroy$UNIX2003) it appears that you may be using an old version, as that issue was resolved, here: www.un4seen.com/forum/?topic=10910.msg83942#msg83942Please check the date of the files that you have. The current LIBBASS.A file is dated 02/12/2010. If yours is older, perhaps you re-received the version that you downloaded a year ago from your browser's cache? You could try clearing the cache and re-downloading.
|
|
|
|
|
Logged
|
|
|
|
|
darren
Posts: 6
|
 |
« Reply #119 on: 18 Jan '11 - 18:08 » |
Quote
|
BASSmix isn't a plugin in the sense that BASSFLAC/etc is, ie. it can't be loaded via BASS_PluginLoad as it doesn't add support for additional file formats. To use the BASSmix functions in your app you just need to add the LIBBASSMIX.A file to your project.
Can you please tell me which package is the LIBBASSMIX.a file is in? I can't seem to find it in the packages I have already downloaded for iPhone and OSX. Oops, found it! 
|
|
|
|
« Last Edit: 18 Jan '11 - 18:29 by darren »
|
Logged
|
|
|
|
|