• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: kAudioSessionProperty_CurrentHardwareInputNumberChannels in MediaPlayback
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: kAudioSessionProperty_CurrentHardwareInputNumberChannels in MediaPlayback


  • Subject: Re: kAudioSessionProperty_CurrentHardwareInputNumberChannels in MediaPlayback
  • From: Michael Tyson <email@hidden>
  • Date: Wed, 08 Aug 2012 11:17:49 +0100

Thanks Peter! Yeah, that one works fine, but not the channel count.

I have discovered the solution, though:

You can switch to PlayAndRecord, query the property, then switch back to the prior category straight away.

It turns out, also, that as long as one app on the device is running in PlayAndRecord/RecordAudio, any other app, regardless of the session category, can query that property.  So, it's perfect, as the only time you need to switch to PlayAndRecord to query the session property is when no other app is using that property, which means there'll be no audio session interruptions caused anyway.



On 8 Aug 2012, at 00:50, support (One Red Dog Media) <email@hidden> wrote:

Hi Michael

I had a similar problem and ended up just testing for kAudioSessionProperty_AudioInputAvailable but of course that doesn't tell you the number of input channels.....

cheers
peter

On 08/08/2012, at 5:46 AM, Michael Tyson <email@hidden> wrote:

Hey folks,

On iOS, does anyone know a way to obtain the number of hardware input channels while in the MediaPlayback audio session category?

I discovered today - much to my embarrassment - that recording is not only possible in the MediaPlayback audio category, but is in fact much more multitasking-friendly. I always used PlayAndRecord whenever doing any recording stuff, as per Apple's guidelines, and was simply used to the fact that only one app could use this category at a time. After discovering another app happily pulling away at the mic audio at the same time as an app using PlayAndRecord, I realised that MediaPlayback was a viable option for a recording app. This is simply fantastic, as it enables my music app to coexist even better with other music apps.

Unfortunately, however, querying the kAudioSessionProperty_CurrentHardwareInputNumberChannels property spews a "!cat" error (incompatible category).  I just gotta have that property value.

I'm aware that I could switch to PlayAndRecord/Record for the duration of the session property query, but I don't like that option due to the fact that it'll clobber any other app using a Record category.

Anyone have any ideas?

Many thanks,
Michael
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >kAudioSessionProperty_CurrentHardwareInputNumberChannels in MediaPlayback (From: Michael Tyson <email@hidden>)
 >Re: kAudioSessionProperty_CurrentHardwareInputNumberChannels in MediaPlayback (From: "support (One Red Dog Media)" <email@hidden>)

  • Prev by Date: Re: kAudioUnitSubType_MultiChannelMixer: Mixing 8 channels down to 2 channels [Mac]
  • Next by Date: Using MediaPlayback session category in a recording app
  • Previous by thread: Re: kAudioSessionProperty_CurrentHardwareInputNumberChannels in MediaPlayback
  • Next by thread: Using MediaPlayback session category in a recording app
  • Index(es):
    • Date
    • Thread