Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // AudioGuidance.swift
- // StyleAndFit
- //
- // Created by Nikolay Genov on 11/16/17.
- // Copyright © 2017 Programista; All rights reserved.
- //
- import AVFoundation
- enum AudioGuidance: Int {
- case pressRecord
- case front
- case handsDown
- case handsUp
- case background
- case holdStill
- case three
- case two
- case one
- case takePhone
- static let fileExtension = "mp3"
- private var resources: [String] {
- switch self {
- case .pressRecord:
- return ["press_record"]
- case .front:
- return ["front","blank", "front_2","blank","front_3", "blank"]
- case .handsDown:
- return ["hands_down", "blank", "hands_down_2", "blank", "hands_down_3", "blank"]
- case .handsUp:
- return ["hands_up", "blank", "hands_up_2", "blank"]
- case .background:
- return ["move_out", "blank"]
- case .holdStill:
- return ["hold_still", "blank"]
- case .three:
- return ["3"]
- case .two:
- return ["2"]
- case .one:
- return ["1"]
- case .takePhone:
- #if B2C
- return ["take_phone_face"]
- #else
- return ["take_phone"]
- #endif
- }
- }
- public var playerItems: [AVPlayerItem] {
- return resources
- .map { Bundle.main.url(forResource: $0, withExtension: AudioGuidance.fileExtension)! }
- .map { AVPlayerItem(url: $0) }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement