ios 打开扬声器

    [[UIDevice currentDevice] setProximityMonitoringEnabled:YES];

    AVAudioSession *audioSession = [AVAudioSession sharedInstance];

    

    //默认情况下扬声器播放

    [audioSession setCategory:AVAudioSessionCategoryPlayback withOptions:AVAudioSessionCategoryOptionMixWithOthers error:nil];

    

    [audioSession setActive:YES error:nil];

posted on 2017-05-24 13:22  廖利君  阅读(741)  评论(0编辑  收藏  举报