Skip to content

Commit

Permalink
MSDK-6470 - Update MSDK to 8.0.0. Implement connected headphone ident…
Browse files Browse the repository at this point in the history
…ification. (#6)

* Bump SDK to 8.0.0

* Add documentation and example code for connected headphone identification

* Fix MSDK version in README
  • Loading branch information
hozefa26 authored Jul 18, 2023
1 parent 55a59a0 commit f961e11
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@
## 1.1.0
- Fix crash due to missing usage descriptions
- Add new Core tab with latest test results

## 2.0.0
- Update MSDK to v8.0.0
- Added `PartnerHeadphoneConnectivityController` to illustrate implementation of connected headphone identification.
20 changes: 16 additions & 4 deletions IntegrationExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
BD3C1D6929D5858B00062126 /* CoreView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD3C1D6829D5858B00062126 /* CoreView.swift */; };
BD3C1D6E29D599D600062126 /* TestViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD3C1D6D29D599D600062126 /* TestViewModel.swift */; };
BD3C1D7229D59AFF00062126 /* TestView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD3C1D7129D59AFF00062126 /* TestView.swift */; };
BD50801C2A66994600971D55 /* PartnerHeadphoneConnectivityController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD50801B2A66994600971D55 /* PartnerHeadphoneConnectivityController.swift */; };
BD7A05E1295EEAF300604BE9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD7A05E0295EEAF300604BE9 /* AppDelegate.swift */; };
BD7A05E4295EFF6200604BE9 /* PartnerAudioProcessingController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD7A05E3295EFF6200604BE9 /* PartnerAudioProcessingController.swift */; };
BD7A05E6295EFFC200604BE9 /* ProcessingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD7A05E5295EFFC200604BE9 /* ProcessingView.swift */; };
Expand Down Expand Up @@ -71,6 +72,7 @@
BD3C1D6D29D599D600062126 /* TestViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestViewModel.swift; sourceTree = "<group>"; };
BD3C1D7129D59AFF00062126 /* TestView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestView.swift; sourceTree = "<group>"; };
BD457B16295C3E710000EE19 /* IntegrationExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = IntegrationExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
BD50801B2A66994600971D55 /* PartnerHeadphoneConnectivityController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PartnerHeadphoneConnectivityController.swift; sourceTree = "<group>"; };
BD7A05E0295EEAF300604BE9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
BD7A05E3295EFF6200604BE9 /* PartnerAudioProcessingController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PartnerAudioProcessingController.swift; sourceTree = "<group>"; };
BD7A05E5295EFFC200604BE9 /* ProcessingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProcessingView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -145,8 +147,8 @@
BD3C1D6729D5855E00062126 /* Core */ = {
isa = PBXGroup;
children = (
BD3C1D6829D5858B00062126 /* CoreView.swift */,
BD3C1D6C29D599BF00062126 /* Test */,
BD50801A2A66986A00971D55 /* View */,
BD50801B2A66994600971D55 /* PartnerHeadphoneConnectivityController.swift */,
);
path = Core;
sourceTree = "<group>";
Expand Down Expand Up @@ -188,6 +190,15 @@
path = IntegrationExample;
sourceTree = "<group>";
};
BD50801A2A66986A00971D55 /* View */ = {
isa = PBXGroup;
children = (
BD3C1D6829D5858B00062126 /* CoreView.swift */,
BD3C1D6C29D599BF00062126 /* Test */,
);
path = View;
sourceTree = "<group>";
};
BD7A05E2295EFD2100604BE9 /* Processing */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -314,6 +325,7 @@
files = (
BD3C1D7229D59AFF00062126 /* TestView.swift in Sources */,
BDAA5D40296BC5790085D636 /* ProcessingViewModel.swift in Sources */,
BD50801C2A66994600971D55 /* PartnerHeadphoneConnectivityController.swift in Sources */,
BDC31C0B295DC1DF002C7F65 /* MimiProfileView.swift in Sources */,
BDE4028B2993B40F008BFC0E /* AppSecrets.generated.swift in Sources */,
BD3C1D6E29D599D600062126 /* TestViewModel.swift in Sources */,
Expand Down Expand Up @@ -471,7 +483,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1;
MARKETING_VERSION = 2.0.0;
PRODUCT_BUNDLE_IDENTIFIER = io.mimi.IntegrationExample;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -509,7 +521,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1;
MARKETING_VERSION = 2.0.0;
PRODUCT_BUNDLE_IDENTIFIER = io.mimi.IntegrationExample;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
5 changes: 5 additions & 0 deletions IntegrationExample/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import MimiSDK
final class AppDelegate: NSObject, UIApplicationDelegate {

private let firmwareController: FirmwareControlling = PartnerFirmwareController()
private let headphoneConnectivityController = PartnerHeadphoneConnectivityController()
private var audioProcessingController: PartnerAudioProcessingController!

// MARK: UIApplicationDelegate
Expand All @@ -39,6 +40,10 @@ final class AppDelegate: NSObject, UIApplicationDelegate {
// Start SDK
Mimi.start(credentials: .client(id: AppSecrets.mimiClientId, secret: AppSecrets.mimiClientSecret),
delegate: self)

// Set up headphone connectivity
// For more documentation on this see: https://mimihearingtechnologies.github.io/SDKDocs-iOS/master/connected-headphone-identification.html
MimiCore.shared.test.connectedHeadphoneProvider = headphoneConnectivityController
}

private func activateMimiProcessing(techLevel: Int) throws -> MimiProcessingSession {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// PartnerHeadphoneConnectivityController.swift
// IntegrationExample
//
// Created by Hozefa Indorewala on 18.07.23.
//

import Foundation
import MimiCoreKit

/// A mock headphone connectivity controller which provides information on the currently connected headphone to the MSDK.
/// Documentation: https://mimihearingtechnologies.github.io/SDKDocs-iOS/master/connected-headphone-identification.html
final class PartnerHeadphoneConnectivityController: MimiConnectedHeadphoneProvider {

enum ConnectivityState {
case disconnected
case connected(model: String)
}

var state: ConnectivityState = .connected(model: "mimi-partner-headphone-model") // Mock headphone model value.

func getMimiHeadphoneIdentifier() -> MimiHeadphoneIdentifier? {

switch state {
case .disconnected:
// Return nil if no headphone is currently connected.
return nil
case .connected(let model):
// If headphone connected, return the headphone identifier based on the headphone model value.
return MimiHeadphoneIdentifier(model: model)
}
}
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation
import MimiCoreKit

/// An mock interface for communicating with the `Mimi Processing Library` on the Mimi enabled device's firmware.
/// A mock interface for communicating with the `Mimi Processing Library` on the Mimi enabled device's firmware.
protocol FirmwareControlling {

func getTechLevel() -> Int
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Integration Example app for iOS is primarily meant for Mimi's partners to help t

To build the project you need the following pre-requisites:
- Your Mimi Client Id and Secret to allow you to communicate with the Mimi API.
- MimiSDK v7 frameworks.
- MimiSDK v8 frameworks.
- [Sourcery](https://github.com/krzysztofzablocki/Sourcery) (`brew install sourcery`).
- [Xcode 14](https://apps.apple.com/gb/app/xcode/id497799835?mt=12) (or latest available) installed including the Xcode Command Line Tools.

Expand All @@ -32,6 +32,7 @@ The code outlining the usage of the Mimi Processing APIs can be found under the

- `PartnerFirmwareController` - A mock implementation of an object that communicates with the `Mimi Processing Library` on the Mimi enabled device's firmware.
- `PartnerAudioProcessingController` - A mock audio processing controller which illustrates the usage of the Mimi Processing Parameter Applicators.
- `PartnerHeadphoneConnectivityController - A mock headphone connectivity controller which provides information on the currently connected headphone to the MSDK.
- `ProcessingView` & `ProcessingViewModel` - These files illustrate the usage of the Mimi Processing Parameters.

### Additional Documentation
Expand Down

0 comments on commit f961e11

Please sign in to comment.