Forcing iPhone Microphone as Audio Input

后端 未结 5 1383
深忆病人
深忆病人 2020-12-03 08:16

I am developing an iOS application (targetted specifically for iPhone, at the moment) that requires the application to record audio only from iPhone internal microph

5条回答
  •  盖世英雄少女心
    2020-12-03 09:18

    I am pretty confident this is possible via your application's Audio Session:

    An audio session is an intermediary between your application and iOS. Each iPhone application has exactly one audio session. You configure it to express your application’s audio intentions. To start, you answer some questions about how you want your application to behave:

    • How do you want your application to respond to interruptions, such as a phone call?
    • Do you intend to mix your application’s sounds with those from other running applications, or do you intend to silence them?
    • How should your application respond to an audio route change, for example, when a user plugs in or unplugs a headset?

    With answers in hand, you employ the audio session interface (declared in AudioToolbox/AudioServices.h) to configure your audio session and your application.

    Dig on these docs:

    • Core Audio Overview - Audio Sessions: Cooperating with Core Audio
    • Audio Session Programming
    • Audio Session Programming - Handling Audio Hardware Route Changes

    And let me know how it goes!

提交回复
热议问题