├── README.md
├── CoreAudioExamples
├── Assets.xcassets
│ ├── Contents.json
│ ├── AccentColor.colorset
│ │ └── Contents.json
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── MenuItemCell.swift
├── Samples
│ ├── AudioUnitGenerateWave
│ │ ├── AudioUnitGenerateWaveViewController.swift
│ │ ├── AudioUnitGenerateWave.storyboard
│ │ └── AudioUnitWaveGenerator.swift
│ ├── AudioEngeneGenerateWave
│ │ ├── AudioEngeneGenerateWaveViewController.swift
│ │ ├── AudioEngeneWaveGenerator.swift
│ │ └── AudioEngeneGenerateWave.storyboard
│ ├── Synthesizer
│ │ ├── SynthesizerViewController.swift
│ │ ├── Synthesizer.swift
│ │ └── Synthesizer.storyboard
│ └── AudioUnitRecording
│ │ ├── Base.lproj
│ │ └── AudioUnitRecording.storyboard
│ │ ├── AudioUnitRecordingViewController.swift
│ │ ├── AudioWriter.swift
│ │ └── AudioUnitRecorder.swift
├── MenuViewController.swift
├── AppDelegate.swift
├── MenuDataSource.swift
├── Base.lproj
│ └── LaunchScreen.storyboard
├── Info.plist
├── SceneDelegate.swift
└── Main.storyboard
├── CoreAudioExamples.xcodeproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── xcuserdata
│ └── tokyomac.xcuserdatad
│ │ └── xcschemes
│ │ └── xcschememanagement.plist
└── project.pbxproj
├── CoreAudioExamplesTests
├── Info.plist
└── CoreAudioExamplesTests.swift
├── CoreAudioExamplesUITests
├── Info.plist
└── CoreAudioExamplesUITests.swift
└── .gitignore
/README.md:
--------------------------------------------------------------------------------
1 | # CoreAudioExamples
2 |
--------------------------------------------------------------------------------
/CoreAudioExamples/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/CoreAudioExamples.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CoreAudioExamples/Assets.xcassets/AccentColor.colorset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "colors" : [
3 | {
4 | "idiom" : "universal"
5 | }
6 | ],
7 | "info" : {
8 | "author" : "xcode",
9 | "version" : 1
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/CoreAudioExamples.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/CoreAudioExamples.xcodeproj/xcuserdata/tokyomac.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | CoreAudioExamples.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/CoreAudioExamples/MenuItemCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // MenuItemTableViewCell.swift
3 | // ExampleOfiOSLiDAR
4 | //
5 | // Created by TokyoYoshida on 2021/01/31.
6 | //
7 |
8 | import UIKit
9 |
10 | class MenuItemCell: UITableViewCell {
11 | @IBOutlet weak var titleLabel: UILabel!
12 | @IBOutlet weak var descriptionLabel: UILabel!
13 |
14 | override func awakeFromNib() {
15 | super.awakeFromNib()
16 | }
17 |
18 | override func setSelected(_ selected: Bool, animated: Bool) {
19 | super.setSelected(selected, animated: animated)
20 | }
21 |
22 | func update(item: MenuItem) {
23 | titleLabel.text = item.title
24 | descriptionLabel.text = item.description
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/CoreAudioExamplesTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE)
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/CoreAudioExamplesUITests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE)
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/CoreAudioExamplesTests/CoreAudioExamplesTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CoreAudioExamplesTests.swift
3 | // CoreAudioExamplesTests
4 | //
5 | // Created by TokyoYoshida on 2021/03/05.
6 | //
7 |
8 | import XCTest
9 | @testable import CoreAudioExamples
10 |
11 | class CoreAudioExamplesTests: XCTestCase {
12 |
13 | override func setUpWithError() throws {
14 | // Put setup code here. This method is called before the invocation of each test method in the class.
15 | }
16 |
17 | override func tearDownWithError() throws {
18 | // Put teardown code here. This method is called after the invocation of each test method in the class.
19 | }
20 |
21 | func testExample() throws {
22 | // This is an example of a functional test case.
23 | // Use XCTAssert and related functions to verify your tests produce the correct results.
24 | }
25 |
26 | func testPerformanceExample() throws {
27 | // This is an example of a performance test case.
28 | self.measure {
29 | // Put the code you want to measure the time of here.
30 | }
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/CoreAudioExamples/Samples/AudioUnitGenerateWave/AudioUnitGenerateWaveViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // GenerateWaveViewController.swift
3 | // CoreAudioExamples
4 | //
5 | // Created by TokyoYoshida on 2021/03/18.
6 | //
7 |
8 | import UIKit
9 |
10 | class GenerateWaveViewController: UIViewController {
11 | @IBOutlet weak var playButton: UIButton!
12 | var isPlaying = false
13 | let waveGenerator = AudioUnitWaveGenerator()
14 |
15 | override func viewDidLoad() {
16 | super.viewDidLoad()
17 |
18 | waveGenerator.prepare()
19 | // Do any additional setup after loading the view.
20 | }
21 |
22 | override func viewDidDisappear(_ animated: Bool) {
23 | super.viewDidDisappear(animated)
24 |
25 | waveGenerator.dispose()
26 | }
27 |
28 | @IBAction func tappedPlayButton(_ sender: Any) {
29 | func start() {
30 | playButton.setTitle("Stop", for: .normal)
31 | waveGenerator.start()
32 | }
33 | func stop() {
34 | playButton.setTitle("Play", for: .normal)
35 | waveGenerator.stop()
36 | }
37 | if isPlaying {
38 | isPlaying = false
39 | stop()
40 | } else {
41 | isPlaying = true
42 | start()
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/CoreAudioExamples/MenuViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // MenuViewController.swift
3 | // ExampleOfiOSLiDAR
4 | //
5 | // Created by TokyoYoshida on 2021/01/31.
6 | //
7 |
8 | import UIKit
9 |
10 | class MenuViewController: UITableViewController {
11 | let viewModel = MenuViewModel()
12 |
13 | override func viewDidLoad() {
14 | super.viewDidLoad()
15 | }
16 |
17 | override func numberOfSections(in tableView: UITableView) -> Int {
18 | return 1
19 | }
20 |
21 | override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
22 | return viewModel.count
23 | }
24 |
25 | override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
26 | let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! MenuItemCell
27 |
28 | let item = viewModel.item(row: indexPath.row)
29 | cell.update(item: item)
30 |
31 | return cell
32 | }
33 |
34 | override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
35 | let vc = viewModel.viewController(row: indexPath.row)
36 |
37 | navigationController?.pushViewController(vc, animated: true)
38 |
39 | tableView.deselectRow(at: indexPath, animated: true)
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/CoreAudioExamples/Samples/AudioEngeneGenerateWave/AudioEngeneGenerateWaveViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AudioEngeneGenerateWaveViewController.swift
3 | // CoreAudioExamples
4 | //
5 | // Created by TokyoYoshida on 2021/03/20.
6 | //
7 |
8 | import UIKit
9 |
10 | class AudioEngeneGenerateWaveViewController: UIViewController {
11 | @IBOutlet weak var playButton: UIButton!
12 | var isPlaying = false
13 | let waveGenerator = AudioEngeneWaveGenerator()
14 |
15 | override func viewDidLoad() {
16 | super.viewDidLoad()
17 |
18 | waveGenerator.prepare()
19 | // Do any additional setup after loading the view.
20 | }
21 |
22 | override func viewDidDisappear(_ animated: Bool) {
23 | super.viewDidDisappear(animated)
24 |
25 | waveGenerator.dispose()
26 | }
27 |
28 | @IBAction func tappedPlayButton(_ sender: Any) {
29 | func start() {
30 | playButton.setTitle("Stop", for: .normal)
31 | waveGenerator.start()
32 | }
33 | func stop() {
34 | playButton.setTitle("Play", for: .normal)
35 | waveGenerator.stop()
36 | }
37 | if isPlaying {
38 | isPlaying = false
39 | stop()
40 | } else {
41 | isPlaying = true
42 | start()
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/CoreAudioExamples/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // CoreAudioExamples
4 | //
5 | // Created by TokyoYoshida on 2021/03/05.
6 | //
7 |
8 | import UIKit
9 |
10 | @main
11 | class AppDelegate: UIResponder, UIApplicationDelegate {
12 |
13 |
14 |
15 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
16 | // Override point for customization after application launch.
17 | return true
18 | }
19 |
20 | // MARK: UISceneSession Lifecycle
21 |
22 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
23 | // Called when a new scene session is being created.
24 | // Use this method to select a configuration to create the new scene with.
25 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
26 | }
27 |
28 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) {
29 | // Called when the user discards a scene session.
30 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
31 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return.
32 | }
33 |
34 |
35 | }
36 |
37 |
--------------------------------------------------------------------------------
/CoreAudioExamplesUITests/CoreAudioExamplesUITests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CoreAudioExamplesUITests.swift
3 | // CoreAudioExamplesUITests
4 | //
5 | // Created by TokyoYoshida on 2021/03/05.
6 | //
7 |
8 | import XCTest
9 |
10 | class CoreAudioExamplesUITests: XCTestCase {
11 |
12 | override func setUpWithError() throws {
13 | // Put setup code here. This method is called before the invocation of each test method in the class.
14 |
15 | // In UI tests it is usually best to stop immediately when a failure occurs.
16 | continueAfterFailure = false
17 |
18 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
19 | }
20 |
21 | override func tearDownWithError() throws {
22 | // Put teardown code here. This method is called after the invocation of each test method in the class.
23 | }
24 |
25 | func testExample() throws {
26 | // UI tests must launch the application that they test.
27 | let app = XCUIApplication()
28 | app.launch()
29 |
30 | // Use recording to get started writing UI tests.
31 | // Use XCTAssert and related functions to verify your tests produce the correct results.
32 | }
33 |
34 | func testLaunchPerformance() throws {
35 | if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) {
36 | // This measures how long it takes to launch your application.
37 | measure(metrics: [XCTApplicationLaunchMetric()]) {
38 | XCUIApplication().launch()
39 | }
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/CoreAudioExamples/MenuDataSource.swift:
--------------------------------------------------------------------------------
1 | //
2 | // MenuDataSource.swift
3 | // ExampleOfiOSLiDAR
4 | //
5 | // Created by TokyoYoshida on 2021/01/31.
6 | //
7 |
8 | import UIKit
9 |
10 | struct MenuItem {
11 | let title: String
12 | let description: String
13 | let prefix: String
14 |
15 | func viewController() -> UIViewController {
16 | let storyboard = UIStoryboard(name: prefix, bundle: nil)
17 | let vc = storyboard.instantiateInitialViewController()!
18 | vc.title = title
19 |
20 | return vc
21 | }
22 | }
23 |
24 | class MenuViewModel {
25 | private let dataSource = [
26 | MenuItem (
27 | title: "AudioUnit Recording",
28 | description: "Sound recording using AudioUnit.",
29 | prefix: "AudioUnitRecording"
30 | ),
31 | MenuItem (
32 | title: "AudioUnit Generate Wave",
33 | description: "Generate sin wave using AudioUnit.",
34 | prefix: "AudioUnitGenerateWave"
35 | ),
36 | MenuItem (
37 | title: "AVAudioEngene Generate Wave",
38 | description: "Generate sin wave using AVAudioEngene.",
39 | prefix: "AudioEngeneGenerateWave"
40 | ),
41 | MenuItem (
42 | title: "Synthesizer",
43 | description: "Synthesizer using AVAudioEngene.",
44 | prefix: "Synthesizer"
45 | )
46 | ]
47 |
48 | var count: Int {
49 | dataSource.count
50 | }
51 |
52 | func item(row: Int) -> MenuItem {
53 | dataSource[row]
54 | }
55 |
56 | func viewController(row: Int) -> UIViewController {
57 | dataSource[row].viewController()
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/CoreAudioExamples/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/CoreAudioExamples/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "scale" : "2x",
6 | "size" : "20x20"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "scale" : "3x",
11 | "size" : "20x20"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "scale" : "2x",
16 | "size" : "29x29"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "scale" : "3x",
21 | "size" : "29x29"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "scale" : "2x",
26 | "size" : "40x40"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "scale" : "3x",
31 | "size" : "40x40"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "scale" : "2x",
36 | "size" : "60x60"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "scale" : "3x",
41 | "size" : "60x60"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "scale" : "1x",
46 | "size" : "20x20"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "scale" : "2x",
51 | "size" : "20x20"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "scale" : "1x",
56 | "size" : "29x29"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "scale" : "2x",
61 | "size" : "29x29"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "scale" : "1x",
66 | "size" : "40x40"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "scale" : "2x",
71 | "size" : "40x40"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "scale" : "1x",
76 | "size" : "76x76"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "scale" : "2x",
81 | "size" : "76x76"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "scale" : "2x",
86 | "size" : "83.5x83.5"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "scale" : "1x",
91 | "size" : "1024x1024"
92 | }
93 | ],
94 | "info" : {
95 | "author" : "xcode",
96 | "version" : 1
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/CoreAudioExamples/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE)
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UIApplicationSceneManifest
24 |
25 | UIApplicationSupportsMultipleScenes
26 |
27 | UISceneConfigurations
28 |
29 | UIWindowSceneSessionRoleApplication
30 |
31 |
32 | UISceneConfigurationName
33 | Default Configuration
34 | UISceneDelegateClassName
35 | $(PRODUCT_MODULE_NAME).SceneDelegate
36 | UISceneStoryboardFile
37 | Main
38 |
39 |
40 |
41 |
42 | UIApplicationSupportsIndirectInputEvents
43 |
44 | UILaunchStoryboardName
45 | LaunchScreen
46 | UIMainStoryboardFile
47 | Main
48 | UIRequiredDeviceCapabilities
49 |
50 | armv7
51 |
52 | UISupportedInterfaceOrientations
53 |
54 | UIInterfaceOrientationPortrait
55 | UIInterfaceOrientationLandscapeLeft
56 | UIInterfaceOrientationLandscapeRight
57 |
58 | UISupportedInterfaceOrientations~ipad
59 |
60 | UIInterfaceOrientationPortrait
61 | UIInterfaceOrientationPortraitUpsideDown
62 | UIInterfaceOrientationLandscapeLeft
63 | UIInterfaceOrientationLandscapeRight
64 |
65 | NSMicrophoneUsageDescription
66 | Recording required.
67 |
68 |
69 |
--------------------------------------------------------------------------------
/CoreAudioExamples/SceneDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SceneDelegate.swift
3 | // CoreAudioExamples
4 | //
5 | // Created by TokyoYoshida on 2021/03/05.
6 | //
7 |
8 | import UIKit
9 |
10 | class SceneDelegate: UIResponder, UIWindowSceneDelegate {
11 |
12 | var window: UIWindow?
13 |
14 |
15 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
16 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
17 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
18 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
19 | guard let _ = (scene as? UIWindowScene) else { return }
20 | }
21 |
22 | func sceneDidDisconnect(_ scene: UIScene) {
23 | // Called as the scene is being released by the system.
24 | // This occurs shortly after the scene enters the background, or when its session is discarded.
25 | // Release any resources associated with this scene that can be re-created the next time the scene connects.
26 | // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
27 | }
28 |
29 | func sceneDidBecomeActive(_ scene: UIScene) {
30 | // Called when the scene has moved from an inactive state to an active state.
31 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
32 | }
33 |
34 | func sceneWillResignActive(_ scene: UIScene) {
35 | // Called when the scene will move from an active state to an inactive state.
36 | // This may occur due to temporary interruptions (ex. an incoming phone call).
37 | }
38 |
39 | func sceneWillEnterForeground(_ scene: UIScene) {
40 | // Called as the scene transitions from the background to the foreground.
41 | // Use this method to undo the changes made on entering the background.
42 | }
43 |
44 | func sceneDidEnterBackground(_ scene: UIScene) {
45 | // Called as the scene transitions from the foreground to the background.
46 | // Use this method to save data, release shared resources, and store enough scene-specific state information
47 | // to restore the scene back to its current state.
48 | }
49 |
50 |
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/CoreAudioExamples/Samples/AudioEngeneGenerateWave/AudioEngeneWaveGenerator.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AudioEngeneWaveGenerator.swift
3 | // CoreAudioExamples
4 | //
5 | // Created by TokyoYoshida on 2021/03/20.
6 | //
7 |
8 | import Foundation
9 | import AVFoundation
10 |
11 | class AudioEngeneWaveGenerator {
12 | var audioUnit: AudioUnit?
13 | var audioEngine: AVAudioEngine = AVAudioEngine()
14 | var sampleRate: Float = 44100.0
15 | var time: Float = 0
16 | var deltaTime: Float = 0
17 | static let toneA: Float = 440.0
18 | var mainMixer: AVAudioMixerNode?
19 | var outputNode: AVAudioOutputNode?
20 | var format: AVAudioFormat?
21 |
22 | lazy var sourceNode = AVAudioSourceNode { [self] (_, _, frameCount, audioBufferList) -> OSStatus in
23 | let abl = UnsafeMutableAudioBufferListPointer(audioBufferList)
24 | for frame in 0.. = UnsafeMutableBufferPointer(buffer)
29 | buf[frame] = sampleVal
30 | }
31 | }
32 | return noErr
33 | }
34 |
35 | class RefConData {
36 | var frame: Float = 0
37 | }
38 | var refData: RefConData = RefConData()
39 |
40 |
41 | func prepare() {
42 | func initAudioEngene() {
43 | mainMixer = audioEngine.mainMixerNode
44 | outputNode = audioEngine.outputNode
45 | format = outputNode!.inputFormat(forBus: 0)
46 |
47 |
48 | sampleRate = Float(format!.sampleRate)
49 | deltaTime = 1 / Float(sampleRate)
50 |
51 | }
52 | initAudioEngene()
53 | }
54 |
55 | func start() {
56 | refData.frame = 0
57 | let inputFormat = AVAudioFormat(commonFormat: format!.commonFormat, sampleRate: Double(sampleRate), channels: 1, interleaved: format!.isInterleaved)
58 | audioEngine.attach(sourceNode)
59 | audioEngine.connect(sourceNode, to: mainMixer!, format: inputFormat!)
60 | audioEngine.connect(mainMixer!, to: outputNode!, format: nil)
61 | mainMixer?.outputVolume = 1
62 |
63 | do {
64 | try audioEngine.start()
65 | } catch {
66 | fatalError("Coud not start engine: \(error.localizedDescription)")
67 | }
68 | }
69 |
70 | func stop() {
71 | audioEngine.stop()
72 | }
73 |
74 | func dispose() {
75 | stop()
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/CoreAudioExamples/Samples/Synthesizer/SynthesizerViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SynthesizerViewController.swift
3 | // CoreAudioExamples
4 | //
5 | // Created by TokyoYoshida on 2021/03/20.
6 | //
7 |
8 | import UIKit
9 |
10 | class SynthesizerViewController: UIViewController {
11 | enum EffectorSwitch: Int {
12 | case Delay = 0
13 | case Phaser
14 | case Flanger
15 | case Distortion
16 | }
17 | @IBOutlet weak var playButton: UIButton!
18 | var isPlaying = false
19 | let waveGenerator = Synthesizer()
20 | var mixer = AudioMixer(TriangleOscillator())
21 |
22 | override func viewDidLoad() {
23 | super.viewDidLoad()
24 |
25 | waveGenerator.prepare()
26 | // Do any additional setup after loading the view.
27 | }
28 |
29 | override func viewDidDisappear(_ animated: Bool) {
30 | super.viewDidDisappear(animated)
31 |
32 | waveGenerator.dispose()
33 | }
34 |
35 | @IBAction func tappedPlayButton(_ sender: Any) {
36 | func start() {
37 | playButton.setTitle("Stop", for: .normal)
38 | // mixer.addEffector(effector: FlangerEffector())
39 | // mixer.addEffector(effector: DelayEffector())
40 | waveGenerator.setAudioSource(audioSource: mixer)
41 | waveGenerator.start()
42 | waveGenerator.volume = 0.5
43 | }
44 | func stop() {
45 | playButton.setTitle("Play", for: .normal)
46 | waveGenerator.stop()
47 | }
48 | if isPlaying {
49 | isPlaying = false
50 | stop()
51 | } else {
52 | isPlaying = true
53 | start()
54 | }
55 | }
56 |
57 | @IBAction func movedSlider(_ sender: UISlider) {
58 | waveGenerator.volume = sender.value
59 | }
60 |
61 | @IBAction func movedTone(_ sender: UISlider) {
62 | let toneA0: Float = 27.50
63 | let toneA5: Float = 880.0
64 |
65 | waveGenerator.tone = (toneA5-toneA0) * sender.value + toneA0
66 | }
67 |
68 | @IBAction func tappedOscillator(_ sender: UISegmentedControl) {
69 | if sender.selectedSegmentIndex == 0 {
70 | mixer.setOscillator(oscillator: SinOscillator())
71 | } else {
72 | mixer.setOscillator(oscillator: TriangleOscillator())
73 | }
74 | }
75 |
76 | @IBAction func tappedEffector(_ sender: UISwitch) {
77 | let selectedSwitch = EffectorSwitch(rawValue: sender.tag)
78 | var effector: Effector
79 | switch selectedSwitch {
80 | case .Delay:
81 | effector = DelayEffector()
82 | case .Phaser:
83 | effector = PhaserEffector()
84 | case .Flanger:
85 | effector = FlangerEffector()
86 | case .Distortion:
87 | effector = DistortionEffector()
88 | case .none:
89 | return
90 | }
91 | if sender.isOn {
92 | mixer.addEffector(index: sender.tag, effector: effector)
93 | } else {
94 | mixer.removeEffector(at: sender.tag)
95 | }
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ### https://raw.github.com/github/gitignore/e931ef7f3e7d8f7aa0e784c14bd291ad4448b1ab/Swift.gitignore
2 |
3 | # Xcode
4 | #
5 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
6 |
7 | ## User settings
8 | xcuserdata/
9 |
10 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
11 | *.xcscmblueprint
12 | *.xccheckout
13 |
14 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
15 | build/
16 | DerivedData/
17 | *.moved-aside
18 | *.pbxuser
19 | !default.pbxuser
20 | *.mode1v3
21 | !default.mode1v3
22 | *.mode2v3
23 | !default.mode2v3
24 | *.perspectivev3
25 | !default.perspectivev3
26 |
27 | ## Obj-C/Swift specific
28 | *.hmap
29 |
30 | ## App packaging
31 | *.ipa
32 | *.dSYM.zip
33 | *.dSYM
34 |
35 | ## Playgrounds
36 | timeline.xctimeline
37 | playground.xcworkspace
38 |
39 | # Swift Package Manager
40 | #
41 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
42 | # Packages/
43 | # Package.pins
44 | # Package.resolved
45 | # *.xcodeproj
46 | #
47 | # Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
48 | # hence it is not needed unless you have added a package configuration file to your project
49 | # .swiftpm
50 |
51 | .build/
52 |
53 | # CocoaPods
54 | #
55 | # We recommend against adding the Pods directory to your .gitignore. However
56 | # you should judge for yourself, the pros and cons are mentioned at:
57 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
58 | #
59 | # Pods/
60 | #
61 | # Add this line if you want to avoid checking in source code from the Xcode workspace
62 | # *.xcworkspace
63 |
64 | # Carthage
65 | #
66 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
67 | # Carthage/Checkouts
68 |
69 | Carthage/Build/
70 |
71 | # Accio dependency management
72 | Dependencies/
73 | .accio/
74 |
75 | # fastlane
76 | #
77 | # It is recommended to not store the screenshots in the git repo.
78 | # Instead, use fastlane to re-generate the screenshots whenever they are needed.
79 | # For more information about the recommended setup visit:
80 | # https://docs.fastlane.tools/best-practices/source-control/#source-control
81 |
82 | fastlane/report.xml
83 | fastlane/Preview.html
84 | fastlane/screenshots/**/*.png
85 | fastlane/test_output
86 |
87 | # Code Injection
88 | #
89 | # After new code Injection tools there's a generated folder /iOSInjectionProject
90 | # https://github.com/johnno1962/injectionforxcode
91 |
92 | iOSInjectionProject/
93 |
94 |
95 | ### https://raw.github.com/github/gitignore/e931ef7f3e7d8f7aa0e784c14bd291ad4448b1ab/Global/Xcode.gitignore
96 |
97 | # Xcode
98 | #
99 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
100 |
101 | ## User settings
102 | xcuserdata/
103 |
104 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
105 | *.xcscmblueprint
106 | *.xccheckout
107 |
108 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
109 | build/
110 | DerivedData/
111 | *.moved-aside
112 | *.pbxuser
113 | !default.pbxuser
114 | *.mode1v3
115 | !default.mode1v3
116 | *.mode2v3
117 | !default.mode2v3
118 | *.perspectivev3
119 | !default.perspectivev3
120 |
121 | ## Gcc Patch
122 | /*.gcno
123 |
124 |
125 |
--------------------------------------------------------------------------------
/CoreAudioExamples/Samples/AudioUnitGenerateWave/AudioUnitGenerateWave.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/CoreAudioExamples/Samples/AudioEngeneGenerateWave/AudioEngeneGenerateWave.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/CoreAudioExamples/Samples/AudioUnitGenerateWave/AudioUnitWaveGenerator.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AudioUnitWaveGenerator.swift
3 | // CoreAudioExamples
4 | //
5 | // Created by TokyoYoshida on 2021/03/18.
6 | //
7 |
8 | import Foundation
9 | import AVFoundation
10 |
11 | class AudioUnitWaveGenerator {
12 | var audioUnit: AudioUnit?
13 | static let sampleRate: Float = 44100.0
14 | static let toneA: Float = 440.0
15 | class RefConData {
16 | var frame: Float = 0
17 | }
18 | var refData: RefConData = RefConData()
19 |
20 | let renderCallBack: AURenderCallback = {(
21 | inRefCon: UnsafeMutableRawPointer,
22 | ioActionFlags: UnsafeMutablePointer,
23 | inTimeStamp: UnsafePointer,
24 | inBusNumber: UInt32,
25 | inNumberFrames: UInt32,
26 | ioData: UnsafeMutablePointer?) -> OSStatus in
27 |
28 | let refData = unsafeBitCast( inRefCon, to: AudioUnitWaveGenerator.RefConData.self)
29 |
30 | let abl = UnsafeMutableAudioBufferListPointer(ioData)
31 | let capacity = Int(abl![0].mDataByteSize) / MemoryLayout.size
32 |
33 | if let buffer = abl![0].mData?.bindMemory(to: Float.self, capacity: capacity) {
34 | for i in 0...passRetained(refData).toOpaque() )
60 |
61 | AudioUnitSetProperty(audioUnit!, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input, 0, &callBackStruct, UInt32(MemoryLayout.size(ofValue: callBackStruct)))
62 | }
63 | func setAudioInputFormat() {
64 | var asbd = AudioStreamBasicDescription()
65 |
66 | asbd.mSampleRate = Float64(AudioUnitWaveGenerator.sampleRate)
67 | asbd.mFormatID = kAudioFormatLinearPCM
68 | asbd.mFormatFlags = kAudioFormatFlagIsFloat
69 | asbd.mChannelsPerFrame = 1
70 | asbd.mBytesPerPacket = UInt32(MemoryLayout.size)
71 | asbd.mBytesPerFrame = UInt32(MemoryLayout.size)
72 | asbd.mFramesPerPacket = 1
73 | asbd.mBitsPerChannel = UInt32(8 * MemoryLayout.size)
74 | asbd.mReserved = 0
75 |
76 | AudioUnitSetProperty(audioUnit!, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &asbd, UInt32(MemoryLayout.size(ofValue: asbd)))
77 | }
78 | initAudioUnit()
79 | setRenderCallBack()
80 | setAudioInputFormat()
81 | }
82 |
83 | func start() {
84 | refData.frame = 0
85 | AudioOutputUnitStart(audioUnit!)
86 | }
87 |
88 | func stop() {
89 | AudioOutputUnitStop(audioUnit!)
90 | }
91 |
92 | func dispose() {
93 | AudioUnitUninitialize(audioUnit!)
94 | AudioComponentInstanceDispose(audioUnit!)
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/CoreAudioExamples/Samples/AudioUnitRecording/Base.lproj/AudioUnitRecording.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
27 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/CoreAudioExamples/Samples/AudioUnitRecording/AudioUnitRecordingViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // CoreAudioExamples
4 | //
5 | // Created by TokyoYoshida on 2021/03/05.
6 | //
7 |
8 | import UIKit
9 | import AVFoundation
10 | import AudioToolbox
11 |
12 | let kOutputBus: UInt32 = 0;
13 | let kInputBus: UInt32 = 1;
14 |
15 | class AudioUnitRecordingViewController: UIViewController {
16 | @IBOutlet weak var recordButton: UIButton!
17 | @IBOutlet weak var playButton: UIButton!
18 |
19 | var audioRecorder: AVAudioRecorder!
20 |
21 | var audioEngine: AVAudioEngine!
22 | var avAudioFile: AVAudioFile!
23 | var audioPlayerNode: AVAudioPlayerNode!
24 | var isRecording: Bool = false
25 |
26 | // for Audio Unit
27 | var mPlayerGraph: AUGraph?
28 | var inputNode: AUNode = 0
29 | var mixerNode: AUNode = 0
30 | var inputNodeUnit: AudioUnit?
31 | var mixerNodeUnit: AudioUnit?
32 | var mBuffers: AudioBufferList?
33 | // for Extended audio file service
34 | let audioWriter = AudioWriter()
35 | let auidoUnitRecorder = AudioUnitRecorder()
36 |
37 | override func viewDidLoad() {
38 | func initAudioRecorder() {
39 | let session = AVAudioSession.sharedInstance()
40 | do {
41 | try session.setCategory(.playAndRecord, mode: .default)
42 | try session.setActive(true)
43 |
44 | auidoUnitRecorder.initializeAudioUnit()
45 | } catch let error {
46 | fatalError(error.localizedDescription)
47 | }
48 | }
49 |
50 | super.viewDidLoad()
51 |
52 | initAudioRecorder()
53 | }
54 |
55 | @IBAction func tappedRecord(_ sender: Any) {
56 | if !isRecording {
57 | isRecording = true
58 | do {
59 | try startRecroding()
60 | } catch (let error) {
61 | print(error)
62 | }
63 | recordButton.setTitle("Stop", for: .normal)
64 | } else {
65 | isRecording = false
66 | endRecording()
67 | recordButton.setTitle("Record", for: .normal)
68 | }
69 | }
70 |
71 | @IBAction func tappedPlay(_ sender: Any) {
72 | func initPlayer() {
73 | do {
74 | audioEngine = AVAudioEngine()
75 | avAudioFile = try AVAudioFile(forReading: getAudioFileUrl())
76 | audioPlayerNode = AVAudioPlayerNode()
77 |
78 | audioEngine.attach(audioPlayerNode)
79 | audioEngine.connect(audioPlayerNode, to: audioEngine.outputNode, format: avAudioFile.processingFormat)
80 | } catch let error {
81 | fatalError(error.localizedDescription)
82 | }
83 | }
84 | initPlayer()
85 | do {
86 | if !audioPlayerNode.isPlaying {
87 | audioPlayerNode.stop()
88 | audioPlayerNode.scheduleFile(avAudioFile, at: nil, completionCallbackType: .dataPlayedBack) {_ in
89 | DispatchQueue.main.async {
90 | self.playButton.setTitle("Play", for: .normal)
91 | }
92 | }
93 |
94 | try audioEngine.start()
95 | audioPlayerNode.play()
96 | playButton.setTitle("Stop", for: .normal)
97 | } else {
98 | audioPlayerNode.stop()
99 | playButton.setTitle("Play", for: .normal)
100 | }
101 | } catch let error {
102 | fatalError(error.localizedDescription)
103 | }
104 | }
105 |
106 | func getAudioFileUrl() -> URL {
107 | let paths = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)
108 | let docsDirect = paths[0]
109 | let audioUrl = docsDirect.appendingPathComponent("recording.wav")
110 |
111 | return audioUrl
112 | }
113 |
114 | }
115 |
116 | extension AudioUnitRecordingViewController: AVAudioRecorderDelegate {
117 | }
118 |
119 | extension AudioUnitRecordingViewController {
120 | func startRecroding() throws {
121 | let fileUrl = getAudioFileUrl()
122 | audioWriter.createAudioFile(url: fileUrl, ofType: kAudioFileWAVEType, audioDesc: auidoUnitRecorder.audioFormat)
123 | auidoUnitRecorder.start(audioWriter)
124 | }
125 |
126 | func endRecording() {
127 | auidoUnitRecorder.stop()
128 | audioWriter.closeAudioFile()
129 | }
130 | }
131 |
132 |
--------------------------------------------------------------------------------
/CoreAudioExamples/Samples/AudioUnitRecording/AudioWriter.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AudioWriter.swift
3 | // CoreAudioExamples
4 | //
5 | // Created by TokyoYoshida on 2021/03/07.
6 | //
7 |
8 | import AVFoundation
9 | import AudioToolbox
10 |
11 | class AudioWriter {
12 | var audioFile: ExtAudioFileRef?
13 |
14 | func createAudioFile(url: URL, ofType type: AudioFileTypeID, audioDesc : AudioStreamBasicDescription) {
15 | var outputDesc = AudioStreamBasicDescription()
16 |
17 | if type == kAudioFileM4AType {
18 | outputDesc.mFormatID = kAudioFormatMPEG4AAC
19 | outputDesc.mFormatFlags = AudioFormatFlags(MPEG4ObjectID.AAC_LC.rawValue)
20 | outputDesc.mChannelsPerFrame = audioDesc.mChannelsPerFrame
21 | outputDesc.mSampleRate = audioDesc.mSampleRate
22 | outputDesc.mFramesPerPacket = 1024
23 | outputDesc.mBytesPerFrame = 0
24 | outputDesc.mBytesPerPacket = 0
25 | outputDesc.mBitsPerChannel = 0
26 | outputDesc.mReserved = 0
27 | } else if type == kAudioFileCAFType || type == kAudioFileWAVEType {
28 | outputDesc.mFormatID = kAudioFormatLinearPCM
29 | outputDesc.mFormatFlags = kAudioFormatFlagIsPacked | kAudioFormatFlagIsSignedInteger
30 | outputDesc.mChannelsPerFrame = 1
31 | outputDesc.mSampleRate = audioDesc.mSampleRate
32 | outputDesc.mFramesPerPacket = 1
33 | outputDesc.mBytesPerFrame = 2
34 | outputDesc.mBytesPerPacket = 2
35 | outputDesc.mBitsPerChannel = 16
36 | outputDesc.mReserved = 0
37 | }
38 | let result = ExtAudioFileCreateWithURL(url as CFURL, type, &outputDesc, nil, AudioFileFlags.eraseFile.rawValue, &self.audioFile)
39 | if result != noErr || self.audioFile == nil {
40 | fatalError("Cannot create audio file.")
41 | }
42 | }
43 |
44 | func writeToAudioFile(_ buffers: UnsafePointer, _ numFrames: UInt32) {
45 | guard let audioFile = self.audioFile else {
46 | return
47 | }
48 | let result = ExtAudioFileWrite(audioFile, numFrames, buffers)
49 | if result != noErr {
50 | fatalError("Error write file.\(result)")
51 | }
52 | }
53 |
54 | func closeAudioFile() {
55 | if let audioFile = self.audioFile {
56 | if ExtAudioFileDispose(audioFile) != noErr {
57 | fatalError("Cannot close file.")
58 | }
59 | }
60 | }
61 | }
62 |
63 | func RecordingCallback( inRefCon: UnsafeMutableRawPointer,
64 | ioActionFlags: UnsafeMutablePointer,
65 | inTimeStamp: UnsafePointer,
66 | inBusNumber: UInt32,
67 | inNumberFrames: UInt32,
68 | ioData: UnsafeMutablePointer?) -> (OSStatus)
69 | {
70 | let refData = unsafeBitCast( inRefCon, to: AudioUnitRecorder.RefConData.self)
71 | let dataSize = UInt32( 1 * inNumberFrames * UInt32( MemoryLayout.size ) )
72 | let dataMem = malloc( Int( dataSize ) )
73 | let audioBuffer = AudioBuffer.init( mNumberChannels: 1, mDataByteSize: dataSize, mData: dataMem )
74 | var audioBufferList = AudioBufferList.init( mNumberBuffers: 1, mBuffers: audioBuffer )
75 |
76 | // AudioUnitRender呼び出し
77 | AudioUnitRender( refData.audioUnit!,
78 | ioActionFlags,
79 | inTimeStamp,
80 | inBusNumber,
81 | inNumberFrames,
82 | &audioBufferList )
83 |
84 |
85 | refData.writer?.writeToAudioFile(&audioBufferList, inNumberFrames)
86 |
87 | free(dataMem)
88 |
89 | return noErr
90 | }
91 |
92 | func RenderCallback( inRefCon: UnsafeMutableRawPointer,
93 | ioActionFlags: UnsafeMutablePointer,
94 | inTimeStamp: UnsafePointer,
95 | inBusNumber: UInt32,
96 | inNumberFrames: UInt32,
97 | ioData: UnsafeMutablePointer?) -> (OSStatus)
98 | {
99 | let refData = unsafeBitCast( inRefCon, to: AudioUnitRecorder.RefConData.self)
100 | // LoopSoundsから再生する範囲のAudioBufferを取得
101 | // let end = ( refData.currentLoop?.buffers.count )! % Int( refData.loopDatas.loopCount() )
102 | // let start = end - Int( inNumberFrames ) >= 0 ? end - Int( inNumberFrames ) : 0
103 |
104 | // let arr = refData.loopDatas.get( beginIndex: start, endIndex: end )
105 |
106 | // ioDataのバッファにコピー
107 | let buf = UnsafeMutableBufferPointer( (ioData?.pointee.mBuffers)! )
108 | // for i in 0 ..< arr.count {
109 | // buf[ i ] = arr[ i ]
110 | // }
111 |
112 | return noErr
113 | }
114 |
--------------------------------------------------------------------------------
/CoreAudioExamples/Samples/AudioUnitRecording/AudioUnitRecorder.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AudioUnitRecorder.swift
3 | // CoreAudioExamples
4 | //
5 | // Created by TokyoYoshida on 2021/03/07.
6 | //
7 |
8 | import AVFoundation
9 | import AudioToolbox
10 |
11 | class AudioUnitRecorder {
12 | class RefConData {
13 | var audioUnit: AudioUnit? = nil
14 | var index: Int = 0
15 | var writer: AudioWriter? = nil
16 | }
17 |
18 | var refData: RefConData = RefConData()
19 | var audioFormat = AudioStreamBasicDescription()
20 |
21 | func initializeAudioUnit() {
22 | var acd = AudioComponentDescription()
23 | acd.componentType = kAudioUnitType_Output
24 | acd.componentSubType = kAudioUnitSubType_RemoteIO
25 | acd.componentManufacturer = kAudioUnitManufacturer_Apple
26 | acd.componentFlags = 0
27 | acd.componentFlagsMask = 0
28 |
29 | guard let ac = AudioComponentFindNext(nil, &acd) else { return }
30 | AudioComponentInstanceNew( ac, &( refData.audioUnit ) )
31 |
32 | initializeCallbacks()
33 | initializeEnableIO()
34 | initializeAudioFormat()
35 | initializeAudioUnitSetting()
36 |
37 | AudioUnitInitialize( refData.audioUnit! )
38 | }
39 |
40 | func initializeCallbacks() {
41 | var inputCallback = AURenderCallbackStruct( inputProc: RecordingCallback, inputProcRefCon: Unmanaged.passRetained(refData).toOpaque() )
42 | // var outputCallback = AURenderCallbackStruct( inputProc: RenderCallback, inputProcRefCon: Unmanaged.passRetained(refData).toOpaque() )
43 |
44 | AudioUnitSetProperty( refData.audioUnit!,
45 | kAudioOutputUnitProperty_SetInputCallback,
46 | kAudioUnitScope_Global,
47 | kInputBus,
48 | &inputCallback,
49 | UInt32(MemoryLayout.size ) )
50 |
51 | // AudioUnitSetProperty( refData.audioUnit!,
52 | // kAudioUnitProperty_SetRenderCallback,
53 | // kAudioUnitScope_Global,
54 | // kOutputBus,
55 | // &outputCallback,
56 | // UInt32(MemoryLayout.size ) )
57 | }
58 |
59 | func initializeEnableIO() {
60 | var flag: UInt32 = 1
61 | AudioUnitSetProperty( refData.audioUnit!,
62 | kAudioOutputUnitProperty_EnableIO,
63 | kAudioUnitScope_Input,
64 | kInputBus,
65 | &flag,
66 | UInt32( MemoryLayout.size ) )
67 |
68 | AudioUnitSetProperty( refData.audioUnit!,
69 | kAudioOutputUnitProperty_EnableIO,
70 | kAudioUnitScope_Output,
71 | kOutputBus,
72 | &flag,
73 | UInt32( MemoryLayout.size ) )
74 | }
75 |
76 | func initializeAudioFormat() {
77 |
78 | audioFormat.mSampleRate = 44100.00
79 | audioFormat.mFormatID = kAudioFormatLinearPCM
80 | audioFormat.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked
81 | audioFormat.mFramesPerPacket = 1
82 | audioFormat.mChannelsPerFrame = 1
83 | audioFormat.mBitsPerChannel = 16
84 | audioFormat.mBytesPerPacket = 2
85 | audioFormat.mBytesPerFrame = 2
86 |
87 | AudioUnitSetProperty( refData.audioUnit!,
88 | kAudioUnitProperty_StreamFormat,
89 | kAudioUnitScope_Output,
90 | kInputBus,
91 | &audioFormat,
92 | UInt32( MemoryLayout.size ) )
93 |
94 | AudioUnitSetProperty( refData.audioUnit!,
95 | kAudioUnitProperty_StreamFormat,
96 | kAudioUnitScope_Input,
97 | kOutputBus,
98 | &audioFormat,
99 | UInt32( MemoryLayout.size ))
100 | }
101 |
102 | func initializeAudioUnitSetting() {
103 | var flag = 0
104 | AudioUnitSetProperty( refData.audioUnit!,
105 | kAudioUnitProperty_ShouldAllocateBuffer,
106 | kAudioUnitScope_Output,
107 | kInputBus,
108 | &flag,
109 | UInt32( MemoryLayout.size ) )
110 | }
111 |
112 | func start(_ writer: AudioWriter) {
113 | refData.writer = writer
114 |
115 | AudioOutputUnitStart( refData.audioUnit! )
116 | }
117 |
118 | func stop() {
119 | AudioOutputUnitStop( refData.audioUnit! )
120 |
121 | }
122 | }
123 |
124 |
--------------------------------------------------------------------------------
/CoreAudioExamples/Samples/Synthesizer/Synthesizer.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Synthesizer.swift
3 | // CoreAudioExamples
4 | //
5 | // Created by TokyoYoshida on 2021/03/20.
6 | //
7 |
8 | import Foundation
9 | import AVFoundation
10 |
11 | class Synthesizer {
12 | private var audioEngine: AVAudioEngine = AVAudioEngine()
13 | private var sampleRate: Float = 44100.0
14 | private var time: Float = 0
15 | private var deltaTime: Float = 0
16 | private var mainMixer: AVAudioMixerNode?
17 | private var outputNode: AVAudioOutputNode?
18 | private var format: AVAudioFormat?
19 | private var audioSource: AudioSource?
20 |
21 | var volume: Float {
22 | set {
23 | audioEngine.mainMixerNode.outputVolume = newValue
24 | }
25 | get {
26 | return audioEngine.mainMixerNode.outputVolume
27 | }
28 | }
29 |
30 | var tone: Float? {
31 | set {
32 | if let newValue = newValue {
33 | audioSource?.tone = newValue
34 | }
35 | }
36 | get {
37 | audioSource?.tone
38 | }
39 | }
40 |
41 | lazy var sourceNode = AVAudioSourceNode { [self] (_, _, frameCount, audioBufferList) -> OSStatus in
42 | let abl = UnsafeMutableAudioBufferListPointer(audioBufferList)
43 | guard let oscillator = self.audioSource else {fatalError("Oscillator is nil")}
44 | for frame in 0.. = UnsafeMutableBufferPointer(buffer)
49 | buf[frame] = sampleVal
50 | }
51 | }
52 | return noErr
53 | }
54 |
55 | class RefConData {
56 | var frame: Float = 0
57 | }
58 | var refData: RefConData = RefConData()
59 |
60 |
61 | func prepare() {
62 | func initAudioEngene() {
63 | mainMixer = audioEngine.mainMixerNode
64 | outputNode = audioEngine.outputNode
65 | format = outputNode!.inputFormat(forBus: 0)
66 |
67 |
68 | sampleRate = Float(format!.sampleRate)
69 | deltaTime = 1 / Float(sampleRate)
70 |
71 | }
72 | initAudioEngene()
73 | }
74 |
75 | func start() {
76 | refData.frame = 0
77 | let inputFormat = AVAudioFormat(commonFormat: format!.commonFormat, sampleRate: Double(sampleRate), channels: 1, interleaved: format!.isInterleaved)
78 | audioEngine.attach(sourceNode)
79 | audioEngine.connect(sourceNode, to: mainMixer!, format: inputFormat!)
80 | audioEngine.connect(mainMixer!, to: outputNode!, format: nil)
81 | mainMixer?.outputVolume = 0
82 |
83 | do {
84 | try audioEngine.start()
85 | } catch {
86 | fatalError("Coud not start engine: \(error.localizedDescription)")
87 | }
88 | }
89 |
90 | func setAudioSource(audioSource: AudioSource) {
91 | self.audioSource = audioSource
92 | }
93 |
94 | func stop() {
95 | audioEngine.stop()
96 | }
97 |
98 | func dispose() {
99 | stop()
100 | }
101 | }
102 |
103 | protocol AudioSource {
104 | var tone: Float {get set}
105 | func signal(time: Float) -> Float
106 | }
107 |
108 | protocol Oscillator: AudioSource {}
109 |
110 | class ToneAdjuster: Oscillator {
111 | var currentTone: Float = 440.0
112 | var targetTone: Float = 440.0
113 | var tone: Float {
114 | set {
115 | targetTone = newValue
116 | }
117 | get {
118 | currentTone
119 | }
120 | }
121 |
122 | func signal(time: Float) -> Float {
123 | return 0
124 | }
125 |
126 | func updateTone() {
127 | currentTone += (targetTone - currentTone) / 1000000
128 | }
129 | }
130 |
131 | class SinOscillator: ToneAdjuster {
132 | override func signal(time: Float) -> Float {
133 | updateTone()
134 | return sin(currentTone * 2.0 * Float(Double.pi) * time)
135 | }
136 |
137 | }
138 |
139 | class TriangleOscillator: ToneAdjuster {
140 | override func signal(time: Float) -> Float {
141 | updateTone()
142 |
143 | let amplitude: Float = 1
144 | let periood = 1.0 / Double(currentTone)
145 | let currentTime = fmod(Double(time), periood)
146 | let value = currentTime / periood
147 |
148 | var result = 0.0
149 |
150 | switch value {
151 | case 0..<0.25:
152 | result = value * 4
153 | case 0.25..<0.75:
154 | result = 2.0 - (value * 4.0)
155 | default:
156 | result = value * 4 - 4.0
157 | }
158 | return amplitude * Float(result)
159 | }
160 | }
161 |
162 | class RingBuffer {
163 | let max: Int
164 | var data: [T?]
165 | var head: Int = 0
166 | var num: Int = 0
167 |
168 | init(_ max: Int) {
169 | self.max = max
170 | self.data = Array(repeating: nil, count: max)
171 | }
172 |
173 | func enqueue(_ data: T) -> Bool {
174 | guard num < max else { return false }
175 |
176 | self.data[(head + num) % max] = data
177 | num += 1
178 | return true
179 | }
180 |
181 | func dequeue() -> T? {
182 | guard num > 0 else { return nil }
183 |
184 | let ret = self.data[head]
185 | data[head] = nil
186 | num -= 1
187 | head = (head + 1) % max
188 |
189 | return ret
190 | }
191 | }
192 |
193 | protocol Effector {
194 | func signal(waveValue: Float, time: Float) -> Float
195 | }
196 |
197 | class DelayEffector: Effector {
198 | var delayCount = 22_100
199 | lazy var buffer = RingBuffer(delayCount + 1)
200 | var index: Int = 0
201 |
202 | func signal(waveValue: Float, time: Float) -> Float {
203 | func enqueue(_ value: Float) {
204 | if !buffer.enqueue(value) {
205 | fatalError("Cannot enqueue buffer.")
206 | }
207 | }
208 | if delayCount > 0 {
209 | delayCount -= 1
210 | enqueue(waveValue)
211 | return waveValue
212 | }
213 | if let delayValue = buffer.dequeue() {
214 | let ret = waveValue + delayValue*0.4
215 | enqueue(ret)
216 | return ret
217 | }
218 | fatalError("Cannot dequeue buffer.")
219 | }
220 | }
221 |
222 | class PhaserEffector: Effector {
223 | var delayCount = 2_100
224 | lazy var buffer = RingBuffer(delayCount + 1)
225 | var index: Int = 0
226 |
227 | func signal(waveValue: Float, time: Float) -> Float {
228 | func enqueue(_ value: Float) {
229 | if !buffer.enqueue(value) {
230 | fatalError("Cannot enqueue buffer.")
231 | }
232 | }
233 | enqueue(waveValue)
234 | if delayCount > 0 {
235 | delayCount -= 1
236 | return waveValue
237 | }
238 | if let delayValue = buffer.dequeue() {
239 | let ret = waveValue + delayValue
240 | return ret
241 | }
242 | fatalError("Cannot dequeue buffer.")
243 | }
244 | }
245 |
246 | class FlangerEffector: Effector {
247 | var delayCount = 210
248 | lazy var buffer = RingBuffer(delayCount + 1)
249 | var index: Int = 0
250 | var tone: Float = 200.0
251 |
252 | func signal(waveValue: Float, time: Float) -> Float {
253 | func enqueue(_ value: Float) {
254 | if !buffer.enqueue(value) {
255 | fatalError("Cannot enqueue buffer.")
256 | }
257 | }
258 | func lfo(_ waveValue: Float, time: Float) -> Float{
259 | return waveValue * sin(tone * 2.0 * Float(Double.pi) * time)
260 | }
261 | enqueue(waveValue)
262 | if delayCount > 0 {
263 | delayCount -= 1
264 | return waveValue
265 | }
266 | if let delayValue = buffer.dequeue() {
267 | let ret = waveValue + lfo(delayValue, time: time)
268 | return ret
269 | }
270 | fatalError("Cannot dequeue buffer.")
271 | }
272 | }
273 |
274 | class DistortionEffector: Effector {
275 | var delayCount = 210
276 | lazy var buffer = RingBuffer(delayCount + 1)
277 | var index: Int = 0
278 | var tone: Float = 200.0
279 | var amplificationLevel: Float = 1.5
280 | var threshold: Float = 0.9
281 |
282 | func signal(waveValue: Float, time: Float) -> Float {
283 | let result = waveValue * amplificationLevel
284 | if result > threshold {
285 | return threshold
286 | }
287 | if result < -threshold {
288 | return -threshold
289 | }
290 | return result
291 | }
292 | }
293 | protocol Mixer: AudioSource {
294 | func addEffector(index: Int, effector: Effector)
295 | func removeEffector(at index: Int)
296 | }
297 |
298 | class AudioMixer: Mixer {
299 | let semaphore = DispatchSemaphore(value: 1)
300 | private var oscillator: Oscillator
301 | private var effectors: [Int:Effector] = [:]
302 | var tone: Float {
303 | set {
304 | oscillator.tone = newValue
305 | }
306 | get {
307 | oscillator.tone
308 | }
309 | }
310 | init(_ oscillator: Oscillator) {
311 | self.oscillator = oscillator
312 | }
313 |
314 | func signal(time: Float) -> Float {
315 | semaphore.wait()
316 |
317 | var waveValue = oscillator.signal(time: time)
318 | for (_,effector) in effectors {
319 | waveValue = effector.signal(waveValue: waveValue, time: time)
320 | }
321 |
322 | semaphore.signal()
323 |
324 | return waveValue
325 | }
326 |
327 | func addEffector(index: Int, effector: Effector) {
328 | semaphore.wait()
329 |
330 | effectors[index] = effector
331 |
332 | semaphore.signal()
333 | }
334 |
335 | func removeEffector(at index: Int) {
336 | semaphore.wait()
337 |
338 | effectors[index] = nil
339 |
340 | semaphore.signal()
341 | }
342 |
343 | func setOscillator(oscillator: Oscillator) {
344 | semaphore.wait()
345 |
346 | self.oscillator = oscillator
347 |
348 | semaphore.signal()
349 | }
350 | }
351 |
--------------------------------------------------------------------------------
/CoreAudioExamples/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
53 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
--------------------------------------------------------------------------------
/CoreAudioExamples/Samples/Synthesizer/Synthesizer.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
29 |
30 |
31 |
32 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
--------------------------------------------------------------------------------
/CoreAudioExamples.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1E1889DF2605ED6A0068E337 /* Synthesizer.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1E1889DE2605ED6A0068E337 /* Synthesizer.storyboard */; };
11 | 1E1889E42605ED740068E337 /* SynthesizerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E1889E32605ED740068E337 /* SynthesizerViewController.swift */; };
12 | 1E1889E92605ED790068E337 /* Synthesizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E1889E82605ED790068E337 /* Synthesizer.swift */; };
13 | 1E2C1E6225F49CDA00CE5DB1 /* MenuItemCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E2C1E5F25F49CDA00CE5DB1 /* MenuItemCell.swift */; };
14 | 1E2C1E6325F49CDA00CE5DB1 /* MenuDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E2C1E6025F49CDA00CE5DB1 /* MenuDataSource.swift */; };
15 | 1E2C1E6425F49CDA00CE5DB1 /* MenuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E2C1E6125F49CDA00CE5DB1 /* MenuViewController.swift */; };
16 | 1E2C1E8425F49DE300CE5DB1 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1E2C1E8225F49DE300CE5DB1 /* Main.storyboard */; };
17 | 1E2C1E8925F4A1A100CE5DB1 /* AudioUnitRecorder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E2C1E8825F4A1A100CE5DB1 /* AudioUnitRecorder.swift */; };
18 | 1E2C1E8E25F4A1CD00CE5DB1 /* AudioWriter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E2C1E8D25F4A1CD00CE5DB1 /* AudioWriter.swift */; };
19 | 1E6511A42605DDB000A90802 /* AudioEngeneGenerateWave.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1E6511A32605DDB000A90802 /* AudioEngeneGenerateWave.storyboard */; };
20 | 1E6511A92605DDC100A90802 /* AudioEngeneGenerateWaveViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E6511A82605DDC100A90802 /* AudioEngeneGenerateWaveViewController.swift */; };
21 | 1E6511AE2605DE7400A90802 /* AudioEngeneWaveGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E6511AD2605DE7400A90802 /* AudioEngeneWaveGenerator.swift */; };
22 | 1ED48D5626032AC30058E0C0 /* AudioUnitGenerateWave.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1ED48D5526032AC30058E0C0 /* AudioUnitGenerateWave.storyboard */; };
23 | 1ED48D5B26032AF80058E0C0 /* AudioUnitGenerateWaveViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ED48D5A26032AF80058E0C0 /* AudioUnitGenerateWaveViewController.swift */; };
24 | 1ED48D6026032BEC0058E0C0 /* AudioUnitWaveGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ED48D5F26032BEC0058E0C0 /* AudioUnitWaveGenerator.swift */; };
25 | 1EFB080B25F1F0B800D5AC6B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EFB080A25F1F0B800D5AC6B /* AppDelegate.swift */; };
26 | 1EFB080D25F1F0B800D5AC6B /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EFB080C25F1F0B800D5AC6B /* SceneDelegate.swift */; };
27 | 1EFB080F25F1F0B800D5AC6B /* AudioUnitRecordingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EFB080E25F1F0B800D5AC6B /* AudioUnitRecordingViewController.swift */; };
28 | 1EFB081225F1F0B800D5AC6B /* AudioUnitRecording.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1EFB081025F1F0B800D5AC6B /* AudioUnitRecording.storyboard */; };
29 | 1EFB081425F1F0B900D5AC6B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1EFB081325F1F0B900D5AC6B /* Assets.xcassets */; };
30 | 1EFB081725F1F0B900D5AC6B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1EFB081525F1F0B900D5AC6B /* LaunchScreen.storyboard */; };
31 | 1EFB082225F1F0B900D5AC6B /* CoreAudioExamplesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EFB082125F1F0B900D5AC6B /* CoreAudioExamplesTests.swift */; };
32 | 1EFB082D25F1F0B900D5AC6B /* CoreAudioExamplesUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EFB082C25F1F0B900D5AC6B /* CoreAudioExamplesUITests.swift */; };
33 | /* End PBXBuildFile section */
34 |
35 | /* Begin PBXContainerItemProxy section */
36 | 1EFB081E25F1F0B900D5AC6B /* PBXContainerItemProxy */ = {
37 | isa = PBXContainerItemProxy;
38 | containerPortal = 1EFB07FF25F1F0B800D5AC6B /* Project object */;
39 | proxyType = 1;
40 | remoteGlobalIDString = 1EFB080625F1F0B800D5AC6B;
41 | remoteInfo = CoreAudioExamples;
42 | };
43 | 1EFB082925F1F0B900D5AC6B /* PBXContainerItemProxy */ = {
44 | isa = PBXContainerItemProxy;
45 | containerPortal = 1EFB07FF25F1F0B800D5AC6B /* Project object */;
46 | proxyType = 1;
47 | remoteGlobalIDString = 1EFB080625F1F0B800D5AC6B;
48 | remoteInfo = CoreAudioExamples;
49 | };
50 | /* End PBXContainerItemProxy section */
51 |
52 | /* Begin PBXFileReference section */
53 | 1E1889DE2605ED6A0068E337 /* Synthesizer.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Synthesizer.storyboard; sourceTree = ""; };
54 | 1E1889E32605ED740068E337 /* SynthesizerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SynthesizerViewController.swift; sourceTree = ""; };
55 | 1E1889E82605ED790068E337 /* Synthesizer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Synthesizer.swift; sourceTree = ""; };
56 | 1E2C1E5F25F49CDA00CE5DB1 /* MenuItemCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuItemCell.swift; sourceTree = ""; };
57 | 1E2C1E6025F49CDA00CE5DB1 /* MenuDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuDataSource.swift; sourceTree = ""; };
58 | 1E2C1E6125F49CDA00CE5DB1 /* MenuViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuViewController.swift; sourceTree = ""; };
59 | 1E2C1E8325F49DE300CE5DB1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = ../../ExampleOfiOSLiDAR/ExampleOfiOSLiDAR/Base.lproj/Main.storyboard; sourceTree = ""; };
60 | 1E2C1E8825F4A1A100CE5DB1 /* AudioUnitRecorder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioUnitRecorder.swift; sourceTree = ""; };
61 | 1E2C1E8D25F4A1CD00CE5DB1 /* AudioWriter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioWriter.swift; sourceTree = ""; };
62 | 1E6511A32605DDB000A90802 /* AudioEngeneGenerateWave.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = AudioEngeneGenerateWave.storyboard; sourceTree = ""; };
63 | 1E6511A82605DDC100A90802 /* AudioEngeneGenerateWaveViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioEngeneGenerateWaveViewController.swift; sourceTree = ""; };
64 | 1E6511AD2605DE7400A90802 /* AudioEngeneWaveGenerator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioEngeneWaveGenerator.swift; sourceTree = ""; };
65 | 1ED48D5526032AC30058E0C0 /* AudioUnitGenerateWave.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = AudioUnitGenerateWave.storyboard; sourceTree = ""; };
66 | 1ED48D5A26032AF80058E0C0 /* AudioUnitGenerateWaveViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioUnitGenerateWaveViewController.swift; sourceTree = ""; };
67 | 1ED48D5F26032BEC0058E0C0 /* AudioUnitWaveGenerator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioUnitWaveGenerator.swift; sourceTree = ""; };
68 | 1EFB080725F1F0B800D5AC6B /* CoreAudioExamples.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CoreAudioExamples.app; sourceTree = BUILT_PRODUCTS_DIR; };
69 | 1EFB080A25F1F0B800D5AC6B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
70 | 1EFB080C25F1F0B800D5AC6B /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; };
71 | 1EFB080E25F1F0B800D5AC6B /* AudioUnitRecordingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioUnitRecordingViewController.swift; sourceTree = ""; };
72 | 1EFB081125F1F0B800D5AC6B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/AudioUnitRecording.storyboard; sourceTree = ""; };
73 | 1EFB081325F1F0B900D5AC6B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
74 | 1EFB081625F1F0B900D5AC6B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
75 | 1EFB081825F1F0B900D5AC6B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
76 | 1EFB081D25F1F0B900D5AC6B /* CoreAudioExamplesTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoreAudioExamplesTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
77 | 1EFB082125F1F0B900D5AC6B /* CoreAudioExamplesTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreAudioExamplesTests.swift; sourceTree = ""; };
78 | 1EFB082325F1F0B900D5AC6B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
79 | 1EFB082825F1F0B900D5AC6B /* CoreAudioExamplesUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoreAudioExamplesUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
80 | 1EFB082C25F1F0B900D5AC6B /* CoreAudioExamplesUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreAudioExamplesUITests.swift; sourceTree = ""; };
81 | 1EFB082E25F1F0B900D5AC6B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
82 | /* End PBXFileReference section */
83 |
84 | /* Begin PBXFrameworksBuildPhase section */
85 | 1EFB080425F1F0B800D5AC6B /* Frameworks */ = {
86 | isa = PBXFrameworksBuildPhase;
87 | buildActionMask = 2147483647;
88 | files = (
89 | );
90 | runOnlyForDeploymentPostprocessing = 0;
91 | };
92 | 1EFB081A25F1F0B900D5AC6B /* Frameworks */ = {
93 | isa = PBXFrameworksBuildPhase;
94 | buildActionMask = 2147483647;
95 | files = (
96 | );
97 | runOnlyForDeploymentPostprocessing = 0;
98 | };
99 | 1EFB082525F1F0B900D5AC6B /* Frameworks */ = {
100 | isa = PBXFrameworksBuildPhase;
101 | buildActionMask = 2147483647;
102 | files = (
103 | );
104 | runOnlyForDeploymentPostprocessing = 0;
105 | };
106 | /* End PBXFrameworksBuildPhase section */
107 |
108 | /* Begin PBXGroup section */
109 | 1E1889DD2605ED2E0068E337 /* Synthesizer */ = {
110 | isa = PBXGroup;
111 | children = (
112 | 1E1889DE2605ED6A0068E337 /* Synthesizer.storyboard */,
113 | 1E1889E32605ED740068E337 /* SynthesizerViewController.swift */,
114 | 1E1889E82605ED790068E337 /* Synthesizer.swift */,
115 | );
116 | path = Synthesizer;
117 | sourceTree = "";
118 | };
119 | 1E2C1E6D25F49CF000CE5DB1 /* Samples */ = {
120 | isa = PBXGroup;
121 | children = (
122 | 1ED48D5326032A7D0058E0C0 /* AudioUnitRecording */,
123 | 1ED48D5426032A910058E0C0 /* AudioUnitGenerateWave */,
124 | 1E65119A2605DD5600A90802 /* AudioEngeneGenerateWave */,
125 | 1E1889DD2605ED2E0068E337 /* Synthesizer */,
126 | );
127 | path = Samples;
128 | sourceTree = "";
129 | };
130 | 1E65119A2605DD5600A90802 /* AudioEngeneGenerateWave */ = {
131 | isa = PBXGroup;
132 | children = (
133 | 1E6511A32605DDB000A90802 /* AudioEngeneGenerateWave.storyboard */,
134 | 1E6511A82605DDC100A90802 /* AudioEngeneGenerateWaveViewController.swift */,
135 | 1E6511AD2605DE7400A90802 /* AudioEngeneWaveGenerator.swift */,
136 | );
137 | path = AudioEngeneGenerateWave;
138 | sourceTree = "";
139 | };
140 | 1ED48D5326032A7D0058E0C0 /* AudioUnitRecording */ = {
141 | isa = PBXGroup;
142 | children = (
143 | 1EFB080E25F1F0B800D5AC6B /* AudioUnitRecordingViewController.swift */,
144 | 1E2C1E8825F4A1A100CE5DB1 /* AudioUnitRecorder.swift */,
145 | 1E2C1E8D25F4A1CD00CE5DB1 /* AudioWriter.swift */,
146 | 1EFB081025F1F0B800D5AC6B /* AudioUnitRecording.storyboard */,
147 | );
148 | path = AudioUnitRecording;
149 | sourceTree = "";
150 | };
151 | 1ED48D5426032A910058E0C0 /* AudioUnitGenerateWave */ = {
152 | isa = PBXGroup;
153 | children = (
154 | 1ED48D5526032AC30058E0C0 /* AudioUnitGenerateWave.storyboard */,
155 | 1ED48D5A26032AF80058E0C0 /* AudioUnitGenerateWaveViewController.swift */,
156 | 1ED48D5F26032BEC0058E0C0 /* AudioUnitWaveGenerator.swift */,
157 | );
158 | path = AudioUnitGenerateWave;
159 | sourceTree = "";
160 | };
161 | 1EFB07FE25F1F0B800D5AC6B = {
162 | isa = PBXGroup;
163 | children = (
164 | 1EFB080925F1F0B800D5AC6B /* CoreAudioExamples */,
165 | 1EFB082025F1F0B900D5AC6B /* CoreAudioExamplesTests */,
166 | 1EFB082B25F1F0B900D5AC6B /* CoreAudioExamplesUITests */,
167 | 1EFB080825F1F0B800D5AC6B /* Products */,
168 | );
169 | sourceTree = "";
170 | };
171 | 1EFB080825F1F0B800D5AC6B /* Products */ = {
172 | isa = PBXGroup;
173 | children = (
174 | 1EFB080725F1F0B800D5AC6B /* CoreAudioExamples.app */,
175 | 1EFB081D25F1F0B900D5AC6B /* CoreAudioExamplesTests.xctest */,
176 | 1EFB082825F1F0B900D5AC6B /* CoreAudioExamplesUITests.xctest */,
177 | );
178 | name = Products;
179 | sourceTree = "";
180 | };
181 | 1EFB080925F1F0B800D5AC6B /* CoreAudioExamples */ = {
182 | isa = PBXGroup;
183 | children = (
184 | 1EFB080A25F1F0B800D5AC6B /* AppDelegate.swift */,
185 | 1EFB080C25F1F0B800D5AC6B /* SceneDelegate.swift */,
186 | 1E2C1E8225F49DE300CE5DB1 /* Main.storyboard */,
187 | 1E2C1E6025F49CDA00CE5DB1 /* MenuDataSource.swift */,
188 | 1E2C1E5F25F49CDA00CE5DB1 /* MenuItemCell.swift */,
189 | 1E2C1E6125F49CDA00CE5DB1 /* MenuViewController.swift */,
190 | 1E2C1E6D25F49CF000CE5DB1 /* Samples */,
191 | 1EFB081325F1F0B900D5AC6B /* Assets.xcassets */,
192 | 1EFB081525F1F0B900D5AC6B /* LaunchScreen.storyboard */,
193 | 1EFB081825F1F0B900D5AC6B /* Info.plist */,
194 | );
195 | path = CoreAudioExamples;
196 | sourceTree = "";
197 | };
198 | 1EFB082025F1F0B900D5AC6B /* CoreAudioExamplesTests */ = {
199 | isa = PBXGroup;
200 | children = (
201 | 1EFB082125F1F0B900D5AC6B /* CoreAudioExamplesTests.swift */,
202 | 1EFB082325F1F0B900D5AC6B /* Info.plist */,
203 | );
204 | path = CoreAudioExamplesTests;
205 | sourceTree = "";
206 | };
207 | 1EFB082B25F1F0B900D5AC6B /* CoreAudioExamplesUITests */ = {
208 | isa = PBXGroup;
209 | children = (
210 | 1EFB082C25F1F0B900D5AC6B /* CoreAudioExamplesUITests.swift */,
211 | 1EFB082E25F1F0B900D5AC6B /* Info.plist */,
212 | );
213 | path = CoreAudioExamplesUITests;
214 | sourceTree = "";
215 | };
216 | /* End PBXGroup section */
217 |
218 | /* Begin PBXNativeTarget section */
219 | 1EFB080625F1F0B800D5AC6B /* CoreAudioExamples */ = {
220 | isa = PBXNativeTarget;
221 | buildConfigurationList = 1EFB083125F1F0B900D5AC6B /* Build configuration list for PBXNativeTarget "CoreAudioExamples" */;
222 | buildPhases = (
223 | 1EFB080325F1F0B800D5AC6B /* Sources */,
224 | 1EFB080425F1F0B800D5AC6B /* Frameworks */,
225 | 1EFB080525F1F0B800D5AC6B /* Resources */,
226 | );
227 | buildRules = (
228 | );
229 | dependencies = (
230 | );
231 | name = CoreAudioExamples;
232 | productName = CoreAudioExamples;
233 | productReference = 1EFB080725F1F0B800D5AC6B /* CoreAudioExamples.app */;
234 | productType = "com.apple.product-type.application";
235 | };
236 | 1EFB081C25F1F0B900D5AC6B /* CoreAudioExamplesTests */ = {
237 | isa = PBXNativeTarget;
238 | buildConfigurationList = 1EFB083425F1F0B900D5AC6B /* Build configuration list for PBXNativeTarget "CoreAudioExamplesTests" */;
239 | buildPhases = (
240 | 1EFB081925F1F0B900D5AC6B /* Sources */,
241 | 1EFB081A25F1F0B900D5AC6B /* Frameworks */,
242 | 1EFB081B25F1F0B900D5AC6B /* Resources */,
243 | );
244 | buildRules = (
245 | );
246 | dependencies = (
247 | 1EFB081F25F1F0B900D5AC6B /* PBXTargetDependency */,
248 | );
249 | name = CoreAudioExamplesTests;
250 | productName = CoreAudioExamplesTests;
251 | productReference = 1EFB081D25F1F0B900D5AC6B /* CoreAudioExamplesTests.xctest */;
252 | productType = "com.apple.product-type.bundle.unit-test";
253 | };
254 | 1EFB082725F1F0B900D5AC6B /* CoreAudioExamplesUITests */ = {
255 | isa = PBXNativeTarget;
256 | buildConfigurationList = 1EFB083725F1F0B900D5AC6B /* Build configuration list for PBXNativeTarget "CoreAudioExamplesUITests" */;
257 | buildPhases = (
258 | 1EFB082425F1F0B900D5AC6B /* Sources */,
259 | 1EFB082525F1F0B900D5AC6B /* Frameworks */,
260 | 1EFB082625F1F0B900D5AC6B /* Resources */,
261 | );
262 | buildRules = (
263 | );
264 | dependencies = (
265 | 1EFB082A25F1F0B900D5AC6B /* PBXTargetDependency */,
266 | );
267 | name = CoreAudioExamplesUITests;
268 | productName = CoreAudioExamplesUITests;
269 | productReference = 1EFB082825F1F0B900D5AC6B /* CoreAudioExamplesUITests.xctest */;
270 | productType = "com.apple.product-type.bundle.ui-testing";
271 | };
272 | /* End PBXNativeTarget section */
273 |
274 | /* Begin PBXProject section */
275 | 1EFB07FF25F1F0B800D5AC6B /* Project object */ = {
276 | isa = PBXProject;
277 | attributes = {
278 | LastSwiftUpdateCheck = 1230;
279 | LastUpgradeCheck = 1230;
280 | TargetAttributes = {
281 | 1EFB080625F1F0B800D5AC6B = {
282 | CreatedOnToolsVersion = 12.3;
283 | };
284 | 1EFB081C25F1F0B900D5AC6B = {
285 | CreatedOnToolsVersion = 12.3;
286 | TestTargetID = 1EFB080625F1F0B800D5AC6B;
287 | };
288 | 1EFB082725F1F0B900D5AC6B = {
289 | CreatedOnToolsVersion = 12.3;
290 | TestTargetID = 1EFB080625F1F0B800D5AC6B;
291 | };
292 | };
293 | };
294 | buildConfigurationList = 1EFB080225F1F0B800D5AC6B /* Build configuration list for PBXProject "CoreAudioExamples" */;
295 | compatibilityVersion = "Xcode 9.3";
296 | developmentRegion = en;
297 | hasScannedForEncodings = 0;
298 | knownRegions = (
299 | en,
300 | Base,
301 | );
302 | mainGroup = 1EFB07FE25F1F0B800D5AC6B;
303 | productRefGroup = 1EFB080825F1F0B800D5AC6B /* Products */;
304 | projectDirPath = "";
305 | projectRoot = "";
306 | targets = (
307 | 1EFB080625F1F0B800D5AC6B /* CoreAudioExamples */,
308 | 1EFB081C25F1F0B900D5AC6B /* CoreAudioExamplesTests */,
309 | 1EFB082725F1F0B900D5AC6B /* CoreAudioExamplesUITests */,
310 | );
311 | };
312 | /* End PBXProject section */
313 |
314 | /* Begin PBXResourcesBuildPhase section */
315 | 1EFB080525F1F0B800D5AC6B /* Resources */ = {
316 | isa = PBXResourcesBuildPhase;
317 | buildActionMask = 2147483647;
318 | files = (
319 | 1EFB081725F1F0B900D5AC6B /* LaunchScreen.storyboard in Resources */,
320 | 1E1889DF2605ED6A0068E337 /* Synthesizer.storyboard in Resources */,
321 | 1EFB081425F1F0B900D5AC6B /* Assets.xcassets in Resources */,
322 | 1EFB081225F1F0B800D5AC6B /* AudioUnitRecording.storyboard in Resources */,
323 | 1ED48D5626032AC30058E0C0 /* AudioUnitGenerateWave.storyboard in Resources */,
324 | 1E2C1E8425F49DE300CE5DB1 /* Main.storyboard in Resources */,
325 | 1E6511A42605DDB000A90802 /* AudioEngeneGenerateWave.storyboard in Resources */,
326 | );
327 | runOnlyForDeploymentPostprocessing = 0;
328 | };
329 | 1EFB081B25F1F0B900D5AC6B /* Resources */ = {
330 | isa = PBXResourcesBuildPhase;
331 | buildActionMask = 2147483647;
332 | files = (
333 | );
334 | runOnlyForDeploymentPostprocessing = 0;
335 | };
336 | 1EFB082625F1F0B900D5AC6B /* Resources */ = {
337 | isa = PBXResourcesBuildPhase;
338 | buildActionMask = 2147483647;
339 | files = (
340 | );
341 | runOnlyForDeploymentPostprocessing = 0;
342 | };
343 | /* End PBXResourcesBuildPhase section */
344 |
345 | /* Begin PBXSourcesBuildPhase section */
346 | 1EFB080325F1F0B800D5AC6B /* Sources */ = {
347 | isa = PBXSourcesBuildPhase;
348 | buildActionMask = 2147483647;
349 | files = (
350 | 1E1889E92605ED790068E337 /* Synthesizer.swift in Sources */,
351 | 1EFB080F25F1F0B800D5AC6B /* AudioUnitRecordingViewController.swift in Sources */,
352 | 1E2C1E6425F49CDA00CE5DB1 /* MenuViewController.swift in Sources */,
353 | 1ED48D6026032BEC0058E0C0 /* AudioUnitWaveGenerator.swift in Sources */,
354 | 1E1889E42605ED740068E337 /* SynthesizerViewController.swift in Sources */,
355 | 1ED48D5B26032AF80058E0C0 /* AudioUnitGenerateWaveViewController.swift in Sources */,
356 | 1E2C1E6325F49CDA00CE5DB1 /* MenuDataSource.swift in Sources */,
357 | 1E2C1E8E25F4A1CD00CE5DB1 /* AudioWriter.swift in Sources */,
358 | 1E6511A92605DDC100A90802 /* AudioEngeneGenerateWaveViewController.swift in Sources */,
359 | 1E2C1E6225F49CDA00CE5DB1 /* MenuItemCell.swift in Sources */,
360 | 1E6511AE2605DE7400A90802 /* AudioEngeneWaveGenerator.swift in Sources */,
361 | 1E2C1E8925F4A1A100CE5DB1 /* AudioUnitRecorder.swift in Sources */,
362 | 1EFB080B25F1F0B800D5AC6B /* AppDelegate.swift in Sources */,
363 | 1EFB080D25F1F0B800D5AC6B /* SceneDelegate.swift in Sources */,
364 | );
365 | runOnlyForDeploymentPostprocessing = 0;
366 | };
367 | 1EFB081925F1F0B900D5AC6B /* Sources */ = {
368 | isa = PBXSourcesBuildPhase;
369 | buildActionMask = 2147483647;
370 | files = (
371 | 1EFB082225F1F0B900D5AC6B /* CoreAudioExamplesTests.swift in Sources */,
372 | );
373 | runOnlyForDeploymentPostprocessing = 0;
374 | };
375 | 1EFB082425F1F0B900D5AC6B /* Sources */ = {
376 | isa = PBXSourcesBuildPhase;
377 | buildActionMask = 2147483647;
378 | files = (
379 | 1EFB082D25F1F0B900D5AC6B /* CoreAudioExamplesUITests.swift in Sources */,
380 | );
381 | runOnlyForDeploymentPostprocessing = 0;
382 | };
383 | /* End PBXSourcesBuildPhase section */
384 |
385 | /* Begin PBXTargetDependency section */
386 | 1EFB081F25F1F0B900D5AC6B /* PBXTargetDependency */ = {
387 | isa = PBXTargetDependency;
388 | target = 1EFB080625F1F0B800D5AC6B /* CoreAudioExamples */;
389 | targetProxy = 1EFB081E25F1F0B900D5AC6B /* PBXContainerItemProxy */;
390 | };
391 | 1EFB082A25F1F0B900D5AC6B /* PBXTargetDependency */ = {
392 | isa = PBXTargetDependency;
393 | target = 1EFB080625F1F0B800D5AC6B /* CoreAudioExamples */;
394 | targetProxy = 1EFB082925F1F0B900D5AC6B /* PBXContainerItemProxy */;
395 | };
396 | /* End PBXTargetDependency section */
397 |
398 | /* Begin PBXVariantGroup section */
399 | 1E2C1E8225F49DE300CE5DB1 /* Main.storyboard */ = {
400 | isa = PBXVariantGroup;
401 | children = (
402 | 1E2C1E8325F49DE300CE5DB1 /* Base */,
403 | );
404 | name = Main.storyboard;
405 | sourceTree = "";
406 | };
407 | 1EFB081025F1F0B800D5AC6B /* AudioUnitRecording.storyboard */ = {
408 | isa = PBXVariantGroup;
409 | children = (
410 | 1EFB081125F1F0B800D5AC6B /* Base */,
411 | );
412 | name = AudioUnitRecording.storyboard;
413 | sourceTree = "";
414 | };
415 | 1EFB081525F1F0B900D5AC6B /* LaunchScreen.storyboard */ = {
416 | isa = PBXVariantGroup;
417 | children = (
418 | 1EFB081625F1F0B900D5AC6B /* Base */,
419 | );
420 | name = LaunchScreen.storyboard;
421 | sourceTree = "";
422 | };
423 | /* End PBXVariantGroup section */
424 |
425 | /* Begin XCBuildConfiguration section */
426 | 1EFB082F25F1F0B900D5AC6B /* Debug */ = {
427 | isa = XCBuildConfiguration;
428 | buildSettings = {
429 | ALWAYS_SEARCH_USER_PATHS = NO;
430 | CLANG_ANALYZER_NONNULL = YES;
431 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
432 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
433 | CLANG_CXX_LIBRARY = "libc++";
434 | CLANG_ENABLE_MODULES = YES;
435 | CLANG_ENABLE_OBJC_ARC = YES;
436 | CLANG_ENABLE_OBJC_WEAK = YES;
437 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
438 | CLANG_WARN_BOOL_CONVERSION = YES;
439 | CLANG_WARN_COMMA = YES;
440 | CLANG_WARN_CONSTANT_CONVERSION = YES;
441 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
442 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
443 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
444 | CLANG_WARN_EMPTY_BODY = YES;
445 | CLANG_WARN_ENUM_CONVERSION = YES;
446 | CLANG_WARN_INFINITE_RECURSION = YES;
447 | CLANG_WARN_INT_CONVERSION = YES;
448 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
449 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
450 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
451 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
452 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
453 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
454 | CLANG_WARN_STRICT_PROTOTYPES = YES;
455 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
456 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
457 | CLANG_WARN_UNREACHABLE_CODE = YES;
458 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
459 | COPY_PHASE_STRIP = NO;
460 | DEBUG_INFORMATION_FORMAT = dwarf;
461 | ENABLE_STRICT_OBJC_MSGSEND = YES;
462 | ENABLE_TESTABILITY = YES;
463 | GCC_C_LANGUAGE_STANDARD = gnu11;
464 | GCC_DYNAMIC_NO_PIC = NO;
465 | GCC_NO_COMMON_BLOCKS = YES;
466 | GCC_OPTIMIZATION_LEVEL = 0;
467 | GCC_PREPROCESSOR_DEFINITIONS = (
468 | "DEBUG=1",
469 | "$(inherited)",
470 | );
471 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
472 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
473 | GCC_WARN_UNDECLARED_SELECTOR = YES;
474 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
475 | GCC_WARN_UNUSED_FUNCTION = YES;
476 | GCC_WARN_UNUSED_VARIABLE = YES;
477 | IPHONEOS_DEPLOYMENT_TARGET = 14.3;
478 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
479 | MTL_FAST_MATH = YES;
480 | ONLY_ACTIVE_ARCH = YES;
481 | SDKROOT = iphoneos;
482 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
483 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
484 | };
485 | name = Debug;
486 | };
487 | 1EFB083025F1F0B900D5AC6B /* Release */ = {
488 | isa = XCBuildConfiguration;
489 | buildSettings = {
490 | ALWAYS_SEARCH_USER_PATHS = NO;
491 | CLANG_ANALYZER_NONNULL = YES;
492 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
493 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
494 | CLANG_CXX_LIBRARY = "libc++";
495 | CLANG_ENABLE_MODULES = YES;
496 | CLANG_ENABLE_OBJC_ARC = YES;
497 | CLANG_ENABLE_OBJC_WEAK = YES;
498 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
499 | CLANG_WARN_BOOL_CONVERSION = YES;
500 | CLANG_WARN_COMMA = YES;
501 | CLANG_WARN_CONSTANT_CONVERSION = YES;
502 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
503 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
504 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
505 | CLANG_WARN_EMPTY_BODY = YES;
506 | CLANG_WARN_ENUM_CONVERSION = YES;
507 | CLANG_WARN_INFINITE_RECURSION = YES;
508 | CLANG_WARN_INT_CONVERSION = YES;
509 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
510 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
511 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
512 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
513 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
514 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
515 | CLANG_WARN_STRICT_PROTOTYPES = YES;
516 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
517 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
518 | CLANG_WARN_UNREACHABLE_CODE = YES;
519 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
520 | COPY_PHASE_STRIP = NO;
521 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
522 | ENABLE_NS_ASSERTIONS = NO;
523 | ENABLE_STRICT_OBJC_MSGSEND = YES;
524 | GCC_C_LANGUAGE_STANDARD = gnu11;
525 | GCC_NO_COMMON_BLOCKS = YES;
526 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
527 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
528 | GCC_WARN_UNDECLARED_SELECTOR = YES;
529 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
530 | GCC_WARN_UNUSED_FUNCTION = YES;
531 | GCC_WARN_UNUSED_VARIABLE = YES;
532 | IPHONEOS_DEPLOYMENT_TARGET = 14.3;
533 | MTL_ENABLE_DEBUG_INFO = NO;
534 | MTL_FAST_MATH = YES;
535 | SDKROOT = iphoneos;
536 | SWIFT_COMPILATION_MODE = wholemodule;
537 | SWIFT_OPTIMIZATION_LEVEL = "-O";
538 | VALIDATE_PRODUCT = YES;
539 | };
540 | name = Release;
541 | };
542 | 1EFB083225F1F0B900D5AC6B /* Debug */ = {
543 | isa = XCBuildConfiguration;
544 | buildSettings = {
545 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
546 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
547 | CODE_SIGN_STYLE = Automatic;
548 | DEVELOPMENT_TEAM = P67QP7Z567;
549 | INFOPLIST_FILE = CoreAudioExamples/Info.plist;
550 | LD_RUNPATH_SEARCH_PATHS = (
551 | "$(inherited)",
552 | "@executable_path/Frameworks",
553 | );
554 | PRODUCT_BUNDLE_IDENTIFIER = tokyoyoshida.app.CoreAudioExamples;
555 | PRODUCT_NAME = "$(TARGET_NAME)";
556 | SWIFT_VERSION = 5.0;
557 | TARGETED_DEVICE_FAMILY = "1,2";
558 | };
559 | name = Debug;
560 | };
561 | 1EFB083325F1F0B900D5AC6B /* Release */ = {
562 | isa = XCBuildConfiguration;
563 | buildSettings = {
564 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
565 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
566 | CODE_SIGN_STYLE = Automatic;
567 | DEVELOPMENT_TEAM = P67QP7Z567;
568 | INFOPLIST_FILE = CoreAudioExamples/Info.plist;
569 | LD_RUNPATH_SEARCH_PATHS = (
570 | "$(inherited)",
571 | "@executable_path/Frameworks",
572 | );
573 | PRODUCT_BUNDLE_IDENTIFIER = tokyoyoshida.app.CoreAudioExamples;
574 | PRODUCT_NAME = "$(TARGET_NAME)";
575 | SWIFT_VERSION = 5.0;
576 | TARGETED_DEVICE_FAMILY = "1,2";
577 | };
578 | name = Release;
579 | };
580 | 1EFB083525F1F0B900D5AC6B /* Debug */ = {
581 | isa = XCBuildConfiguration;
582 | buildSettings = {
583 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
584 | BUNDLE_LOADER = "$(TEST_HOST)";
585 | CODE_SIGN_STYLE = Automatic;
586 | DEVELOPMENT_TEAM = P67QP7Z567;
587 | INFOPLIST_FILE = CoreAudioExamplesTests/Info.plist;
588 | IPHONEOS_DEPLOYMENT_TARGET = 14.3;
589 | LD_RUNPATH_SEARCH_PATHS = (
590 | "$(inherited)",
591 | "@executable_path/Frameworks",
592 | "@loader_path/Frameworks",
593 | );
594 | PRODUCT_BUNDLE_IDENTIFIER = tokyoyoshida.app.CoreAudioExamplesTests;
595 | PRODUCT_NAME = "$(TARGET_NAME)";
596 | SWIFT_VERSION = 5.0;
597 | TARGETED_DEVICE_FAMILY = "1,2";
598 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CoreAudioExamples.app/CoreAudioExamples";
599 | };
600 | name = Debug;
601 | };
602 | 1EFB083625F1F0B900D5AC6B /* Release */ = {
603 | isa = XCBuildConfiguration;
604 | buildSettings = {
605 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
606 | BUNDLE_LOADER = "$(TEST_HOST)";
607 | CODE_SIGN_STYLE = Automatic;
608 | DEVELOPMENT_TEAM = P67QP7Z567;
609 | INFOPLIST_FILE = CoreAudioExamplesTests/Info.plist;
610 | IPHONEOS_DEPLOYMENT_TARGET = 14.3;
611 | LD_RUNPATH_SEARCH_PATHS = (
612 | "$(inherited)",
613 | "@executable_path/Frameworks",
614 | "@loader_path/Frameworks",
615 | );
616 | PRODUCT_BUNDLE_IDENTIFIER = tokyoyoshida.app.CoreAudioExamplesTests;
617 | PRODUCT_NAME = "$(TARGET_NAME)";
618 | SWIFT_VERSION = 5.0;
619 | TARGETED_DEVICE_FAMILY = "1,2";
620 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CoreAudioExamples.app/CoreAudioExamples";
621 | };
622 | name = Release;
623 | };
624 | 1EFB083825F1F0B900D5AC6B /* Debug */ = {
625 | isa = XCBuildConfiguration;
626 | buildSettings = {
627 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
628 | CODE_SIGN_STYLE = Automatic;
629 | DEVELOPMENT_TEAM = P67QP7Z567;
630 | INFOPLIST_FILE = CoreAudioExamplesUITests/Info.plist;
631 | LD_RUNPATH_SEARCH_PATHS = (
632 | "$(inherited)",
633 | "@executable_path/Frameworks",
634 | "@loader_path/Frameworks",
635 | );
636 | PRODUCT_BUNDLE_IDENTIFIER = tokyoyoshida.app.CoreAudioExamplesUITests;
637 | PRODUCT_NAME = "$(TARGET_NAME)";
638 | SWIFT_VERSION = 5.0;
639 | TARGETED_DEVICE_FAMILY = "1,2";
640 | TEST_TARGET_NAME = CoreAudioExamples;
641 | };
642 | name = Debug;
643 | };
644 | 1EFB083925F1F0B900D5AC6B /* Release */ = {
645 | isa = XCBuildConfiguration;
646 | buildSettings = {
647 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
648 | CODE_SIGN_STYLE = Automatic;
649 | DEVELOPMENT_TEAM = P67QP7Z567;
650 | INFOPLIST_FILE = CoreAudioExamplesUITests/Info.plist;
651 | LD_RUNPATH_SEARCH_PATHS = (
652 | "$(inherited)",
653 | "@executable_path/Frameworks",
654 | "@loader_path/Frameworks",
655 | );
656 | PRODUCT_BUNDLE_IDENTIFIER = tokyoyoshida.app.CoreAudioExamplesUITests;
657 | PRODUCT_NAME = "$(TARGET_NAME)";
658 | SWIFT_VERSION = 5.0;
659 | TARGETED_DEVICE_FAMILY = "1,2";
660 | TEST_TARGET_NAME = CoreAudioExamples;
661 | };
662 | name = Release;
663 | };
664 | /* End XCBuildConfiguration section */
665 |
666 | /* Begin XCConfigurationList section */
667 | 1EFB080225F1F0B800D5AC6B /* Build configuration list for PBXProject "CoreAudioExamples" */ = {
668 | isa = XCConfigurationList;
669 | buildConfigurations = (
670 | 1EFB082F25F1F0B900D5AC6B /* Debug */,
671 | 1EFB083025F1F0B900D5AC6B /* Release */,
672 | );
673 | defaultConfigurationIsVisible = 0;
674 | defaultConfigurationName = Release;
675 | };
676 | 1EFB083125F1F0B900D5AC6B /* Build configuration list for PBXNativeTarget "CoreAudioExamples" */ = {
677 | isa = XCConfigurationList;
678 | buildConfigurations = (
679 | 1EFB083225F1F0B900D5AC6B /* Debug */,
680 | 1EFB083325F1F0B900D5AC6B /* Release */,
681 | );
682 | defaultConfigurationIsVisible = 0;
683 | defaultConfigurationName = Release;
684 | };
685 | 1EFB083425F1F0B900D5AC6B /* Build configuration list for PBXNativeTarget "CoreAudioExamplesTests" */ = {
686 | isa = XCConfigurationList;
687 | buildConfigurations = (
688 | 1EFB083525F1F0B900D5AC6B /* Debug */,
689 | 1EFB083625F1F0B900D5AC6B /* Release */,
690 | );
691 | defaultConfigurationIsVisible = 0;
692 | defaultConfigurationName = Release;
693 | };
694 | 1EFB083725F1F0B900D5AC6B /* Build configuration list for PBXNativeTarget "CoreAudioExamplesUITests" */ = {
695 | isa = XCConfigurationList;
696 | buildConfigurations = (
697 | 1EFB083825F1F0B900D5AC6B /* Debug */,
698 | 1EFB083925F1F0B900D5AC6B /* Release */,
699 | );
700 | defaultConfigurationIsVisible = 0;
701 | defaultConfigurationName = Release;
702 | };
703 | /* End XCConfigurationList section */
704 | };
705 | rootObject = 1EFB07FF25F1F0B800D5AC6B /* Project object */;
706 | }
707 |
--------------------------------------------------------------------------------