       
       // set layeredPlayer
       for (index, file) in _tones.enumerated() {
-        let layeredTones = FM.contentsOfDirectoryAtPath("\(Bundle.mainBundle().resourcePath!)/tones/\(toneDir)/layered", error: nil)
-        if 0 < layeredTones!.count {
+        var layeredTones: [String] = [];
+        do {
+          layeredTones = try FM.contentsOfDirectory(atPath: "\(Bundle.main.resourcePath!)/tones/\(toneDir)/layered")
+        }
+        catch {
+          // do nothing
+          print("Cannot load layeredTones !")
+        }
+        
+        if 0 < layeredTones.count {
           let filePath = Bundle.main.path(forResource: "tones/\(toneDir)/layered/\(file)", ofType: "wav")!
-          let fileURL = URL(fileURLWithPath: filePath)!
-          let audioFile = AVAudioFile(forReading: fileURL, error: nil)
+          let fileURL = URL(fileURLWithPath: filePath)
+          let audioFile = AVAudioFile(forWriting: fileURL, settings: nil)
           let audioFileBuffer = AVAudioPCMBuffer(PCMFormat: audioFile.processingFormat, frameCapacity: UInt32(audioFile.length))
           audioFile.readIntoBuffer(audioFileBuffer, error: nil)
           let player = AVAudioPlayerNode()

    
    // ------------
    
    var items = FM.contentsOfDirectoryAtPath("\(Bundle.mainBundle().resourcePath!)/tones/\(toneDir)", error: nil) as! [String]
    
    // wavファイル以外は無視
    items = items.filter { (name: String) -> Bool in
      var regex = NSRegularExpression(pattern: ".wav$", options: NSRegularExpressionOptions.allZeros, error: nil)
      return regex?.firstMatchInString(name, options: NSMatchingOptions.allZeros, range: NSMakeRange(0, count(name))) != nil
    }
    
    let itemsCount = items.count

    colors["E"] = ["hue":0.070, "saturation":1.0]
    colors["F"] = ["hue":0.190, "saturation":1.0]
    
    do {
      toneDirs = try FM.contentsOfDirectory(atPath: "\(Bundle.main.resourcePath!)/tones")
    }
    catch {
        // do nothing
        print("Cannot load toneDirs !")
    }
    
    // Estimote Beacon
    beaconManager.delegate = self
