Processing Parameter Operations
Available Parameters
The Processing Parameters can be accessed from the MimiProcessingSession instance. The API follows the pattern of session.[feature?].[module?].[parameter]. E.g. To access the isEnabled parameter for Media Sound Personalization, the API is session?.soundPersonalization?.media?.isEnabled.
For a list of available Parameters please refer to the MimiProcessingSession
Observing the current parameter value
The valuePublisher property of the MimiProcessingParameter can be subscribed to as follows.
Example usage:
let subscription = session.soundPersonalization?.media?.isEnabled.valuePublisher
.sink { value in
print("isEnabled parameter value: \(value)")
}
Observing State Changes
This property enables observation of state changes in the ProcessingParameter resulting from a value application process. It emits values of type MimiProcessingParameterUpdateState to notify subscribers about any changes.
Example usage:
// Subscribe to states changes of the isEnabled processing parameter
let subscription = session.soundPersonalization?.media?.isEnabled.updateState
.sink { state in
print("isEnabled parameter update state: \(state)")
}
Updating the value
The parameter value can be updated via the apply(value:) method. This method will attempt to apply the provided value on the associated applicator. For the application to succeed, success must be reported by the applicator that the application is attempted on. If the applicator fails to report success, the application fails, and an error is thrown.
Example usage:
do {
try await session.soundPersonalization?.media?.isEnabled.apply(value)
// Value application succeeded
} catch {
// Handle error
}
Note: For remote parameters e.g. preset, use the load() method which will attempt to load a new parameter value from a remote data source and then apply it on all registered applicators.
Advanced
Synchronizing Applicator
The synchronizeApplicator() function attempts to update the associated Applicator with the current value of the MimiProcessingParameter, if the Applicator is out-of-date.
Parameter Recommendations
Based on certain events in MimiSDK e.g. user authentication, hearing test submission etc, the processing parameters are automatically set to recommended values.
Processing Parameter Operations Reference