Csound Csound-dev Csound-tekno Search About

[Csnd] iOS - Test version with support for bluetooth

Date2013-08-23 21:56
FromSteven Yi
Subject[Csnd] iOS - Test version with support for bluetooth
Hi All,

I've been researching the issue with Bluetooth all day today and I've
got something working.  I've posted a version of Csound for iOS here:

http://kunstmusik.com/csound-iOS-6.00.1.zip

What I modified here is a new flag in CsoundObj called useAudioInput.
By default, it is set to NO.  What I found was that if the audio
category is set to kAudioSessionCategory_PlayAndRecord (what we had
been using), the bluetooth audio output for A2DP was not working.
However, if I switched to using kAudioSessionCategory_MediaPlayback,
Bluetooth would work as one would expect for an application.

The Examples project has been updated where examples requiring audio
input will set "self.csound.useAudioInput = YES".  This is not
automatic at the moment, as the flag setting input (-i adc) is within
the CSD file.  I'll look at making this become automatic.

Just to note, the option to set bluetooth as an output pretty much
disappears just by setting the category. This is just to say that
audiounit settings do not affect if bluetooth will show up or not. The
audiounit code did need to be modified when MediaPlayback is used
though, or it would not output any audio at all.

I did go through most of Apple's documentation and searched on the
internet for more information, but did not see much.  The above
analysis is mostly from testing/debugging.

I'd request that iOS users try this build out and see if:

1. Does Bluetooth output work for you for your projects that do not use input?

2. For iPhones, does audio still default to speaker and not the
receiver?  (I can not test this as I only have an iPad available,
which only has a speaker).

Thanks!
steven