<commit_before>//
//  ViewController.swift
//  MiamiSunglasses
//
//  Created by <NAME> on 9/25/15.
//  Copyright © 2015 <NAME>. All rights reserved.
//

import UIKit
import AVFoundation


class ViewController: UIViewController, AVAudioPlayerDelegate {

    
    var yeah:AVAudioPlayer = AVAudioPlayer()
    var soundIsPlaying:Bool = false;
    
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        //load resource
        let audioURL:
            NSURL = NSBundle.mainBundle().URLForResource("CSI Miami", withExtension: "mp3")!
        
        do {
            yeah = try AVAudioPlayer(contentsOfURL: audioURL, fileTypeHint: nil)
            yeah.delegate = self; //allows audioPlayerDidFinishPlaying to be called
        } catch _ { return }
        
        yeah.numberOfLoops = 1
        //yeah.volume = 1.0 //interesting... maybe i could add a volume slider later...
        yeah.prepareToPlay()
        
        
        
    }
    
    @IBAction func playSound(sender: AnyObject) {
        print(soundIsPlaying)
        <commit_msg>fixed bug where sound would play twice per click...<commit_after>//
//  ViewController.swift
//  MiamiSunglasses
//
//  Created by <NAME> on 9/25/15.
//  Copyright © 2015 <NAME>. All rights reserved.
//

import UIKit
import AVFoundation


class ViewController: UIViewController, AVAudioPlayerDelegate {

    
    var yeah:AVAudioPlayer = AVAudioPlayer()
    var soundIsPlaying:Bool = false;
    
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        //load resource
        let audioURL:
            NSURL = NSBundle.mainBundle().URLForResource("CSI Miami", withExtension: "mp3")!
        
        do {
            yeah = try AVAudioPlayer(contentsOfURL: audioURL, fileTypeHint: nil)
            yeah.delegate = self; //allows audioPlayerDidFinishPlaying to be called
        } catch _ { return }
        
        yeah.numberOfLoops = 0
        //yeah.volume = 1.0 //interesting... maybe i could add a volume slider later...
        yeah.prepareToPlay()
        
        
        
    }
    
    @IBAction func playSound(sender: AnyObject) {
        print(soundIsPlaying)
        
{'fraction_non_alphanumeric': 0.09443430656934307, 'fraction_numerical': 0.011861313868613138, 'mean_word_length': 1.9635135135135136, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '956599', 'n_tokens_mistral': 652, 'n_tokens_neox': 615, 'n_words': 162}