• kAudioSessionProperty_OverrideCategoryDefaultToSpeaker


    1 kAudioSessionProperty_OverrideCategoryDefaultToSpeaker

    指定,在没有耳机和听筒等输出设备的时候,是否将音频通过扬声器输出;

    Discussion
    A read/write UInt32 value. By default, the value of this property is FALSE (0).
    This property retains its value through an audio route change (such as when plugging in or unplugging a headset), and upon interruption; it reverts to its default value only upon an audio session category change. This property can be used only with the kAudioSessionCategory_PlayAndRecord (or the equivalent playAndRecord) category.
    See also kAudioSessionProperty_OverrideAudioRoute.

    注意这个属性只支持 category为playandrecord,不支持什么playback之类的;如果你用的不是playandrecord,那当设置这个speaker属性的时候会报错-50;

    https://developer.apple.com/documentation/audiotoolbox/kaudiosessionproperty_overrideaudioroute

    2 kAudioSessionProperty_OverrideAudioRoute

    Specifies whether or not to override the audio session category’s typical audio route

    A write-only UInt32 value. Can be set with one of two values: kAudioSessionOverrideAudioRoute_None, which specifies that you want to use the typical audio route; and kAudioSessionOverrideAudioRoute_Speaker, when sends output audio to the built-in speaker. This property can be used only with the kAudioSessionCategory_PlayAndRecord (or the equivalent playAndRecord) category.
    If a headset is plugged in at the time you set this property’s value to kAudioSessionOverrideAudioRoute_Speaker, the system changes the audio routing for input as well as for output: input comes from the built-in microphone; output goes to the built-in speaker.
    Upon an audio route change (such as by plugging in or unplugging a headset), or upon interruption, this property reverts to its default value.
  • 相关阅读:
    实验室机器OracleXE客户端连接远程Oracle服务器
    PLSQL Developer 远程连接Oracle XE数据库(其他Oracle数据库类似)
    VB进制转化大全
    给定一个硬盘标识,umout掉所有相关挂载
    linux读取硬盘指定扇区
    开发板上挂载NTFS分区
    write error:file too large!!!
    一些自用的c函数
    主引导记录(MBR)分析
    strtok_r函数学习
  • 原文地址:https://www.cnblogs.com/8335IT/p/16016239.html
Copyright © 2020-2023  润新知