@@ -145,25 +145,34 @@ open class StreamAudioRecorder: NSObject, AudioRecording, AVAudioRecorderDelegat
145
145
self . init ( configuration: . default)
146
146
}
147
147
148
- /// Initialises a new instance of StreamAudioRecorder
148
+ /// Initializes a new `StreamAudioRecorder`.
149
+ ///
149
150
/// - Parameters:
150
- /// - audioSessionConfigurator: The configurator to use to interact with `AVAudioSession`
151
- /// - audioRecorderSettings: The settings that will be used any time a new `AVAudioRecorder` is instantiated
152
- /// - audioFileName: The name of the file that will be used by every `AVAudioRecorder` instance to store in progress recordings.
153
- /// - audioRecorderBaseStorageURL: The path in where we would like to store temporary and finalised recording files.
154
- /// - audioRecorderMeterNormaliser: The normaliser that will be used to transform `AVAudioRecorder's` updated meter values.
155
- public convenience init (
156
- configuration: Configuration
151
+ /// - configuration: Configuration for the recorder.
152
+ /// - audioSessionConfigurator: The object used to interact with `AVAudioSession`. Defaults to `StreamAudioSessionConfigurator()`.
153
+ public init (
154
+ configuration: Configuration ,
155
+ audioSessionConfigurator: AudioSessionConfiguring = StreamAudioSessionConfigurator ( )
157
156
) {
158
- self . init (
159
- configuration: configuration,
160
- audioSessionConfigurator: StreamAudioSessionConfigurator ( ) ,
161
- audioRecorderMeterNormaliser: AudioValuePercentageNormaliser ( ) ,
162
- appStateObserver: StreamAppStateObserver ( ) ,
163
- audioRecorderAVProvider: AVAudioRecorder . init
164
- )
157
+ self . audioSessionConfigurator = audioSessionConfigurator
158
+ self . configuration = configuration
159
+ audioRecorderMeterNormaliser = AudioValuePercentageNormaliser ( )
160
+ appStateObserver = StreamAppStateObserver ( )
161
+ audioRecorderAVProvider = AVAudioRecorder . init
162
+ multicastDelegate = . init( )
163
+
164
+ super. init ( )
165
+
166
+ setUp ( )
165
167
}
166
168
169
+ /// Initialises a new instance of StreamAudioRecorder
170
+ /// - Parameters:
171
+ /// - configuration: Configuration for the recorder.
172
+ /// - audioSessionConfigurator: The object used to interact with `AVAudioSession`.
173
+ /// - audioRecorderMeterNormaliser: Transforms meter values emitted by `AVAudioRecorder` into a normalised range for UI/logic.
174
+ /// - appStateObserver: Observes application lifecycle events that the recorder reacts to.
175
+ /// - audioRecorderAVProvider: Factory closure used to construct `AVAudioRecorder` instances for a given file URL and settings dictionary.
167
176
internal init (
168
177
configuration: Configuration ,
169
178
audioSessionConfigurator: AudioSessionConfiguring ,
0 commit comments