<commit_before>//
//  Luminous+Audio.swift
//  Luminous
//
//  Created by <NAME> on 10/11/2019.
//

import AVFoundation
import Foundation


extension Luminous {
    
    // MARK: Audio
    
    public struct Audio {
        
        /// A value in the range `0.0` to `1.0`, with `0.0` representing the minimum volume and `1.0` representing the maximum volume.
        public static var currentAudioOutputVolume: Double? {
            
            let audioSession = AVAudioSession.sharedInstance()
            do {
                try audioSession.setActive(true)
                let volume = audioSession.outputVolume
                try audioSession.setActive(false)
                return Double(volume)
            } catch {
                print("Luminous - Failed to activate audio session.")
                return nil
            }
        }
        
        /// The value is true when another application with a non-mixable audio session is playing audio.
        public static var secondaryAudioShouldBeSilencedHint: Bool {
            
            return AVAudioSession.sharedInstance().secondaryAudioShouldBeSilencedHint
        }
    }
}
<commit_msg>Fix for playback pausing when getting volume<commit_after>//
//  Luminous+Audio.swift
//  Luminous
//
//  Created by <NAME> on 10/11/2019.
//

import AVFoundation
import Foundation


extension Luminous {
    
    // MARK: Audio
    
    public struct Audio {
        
        /// A value in the range `0.0` to `1.0`, with `0.0` representing the minimum volume and `1.0` representing the maximum volume.
        public static var currentAudioOutputVolume: Double? {
            
            let audioSession = AVAudioSession.sharedInstance()
            do {
                try audioSession.setActive(true)
                let volume = audioSession.outputVolume
                return Double(volume)
            } catch {
                print("Luminous - Failed to activate audio session.")
                return nil
            }
        }
        
        /// The value is true when another application with a non-mixable audio session is playing audio.
        public static var secondaryAudioShouldBeSilencedHint: Bool {
            
            return AVAudioSession.sharedInstance().secondaryAudioShouldBeSilencedHint
        }
    }
}

{'fraction_non_alphanumeric': 0.07325530992631123, 'fraction_numerical': 0.013870827915041179, 'mean_word_length': 1.7476190476190476, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3815179', 'n_tokens_mistral': 599, 'n_tokens_neox': 556, 'n_words': 180}