Skip to content

Commit

Permalink
chore: updated method names
Browse files Browse the repository at this point in the history
  • Loading branch information
demchuk-alex committed Oct 7, 2024
1 parent 152acbb commit fe71346
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions ios/AudioController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,11 @@ public class AudioController {
// }
}

public func reset() throws {
let audioSession = AVAudioSession.sharedInstance()
try audioSession.setActive(false, options: .notifyOthersOnDeactivation)
}

private func scheduleNextBuffer() {
guard let engine = self.audioEngine, engine.isRunning else {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) { // Check every 50 milliseconds
Expand Down
4 changes: 2 additions & 2 deletions ios/ExpoPlayAudioStreamModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public class ExpoPlayAudioStreamModule: Module {
audioController.stop(promise: promise)
}

AsyncFunction("resetAudioSession") { promise in
audioController.deactivateAudioSession()
AsyncFunction("resetAudioSession") { (promise: Promise) in
audioController.reset()
promise.resolve(nil)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import ExpoModulesCore

// This view will be used as a native component. Make sure to inherit from `ExpoView`
// to apply the proper styling (e.g. border radius and shadows).
class ExpoAudioStreamView: ExpoView {
class ExpoPlayAudioStreamView: ExpoView {

}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mykin-ai/expo-audio-stream",
"version": "0.1.27",
"version": "0.1.28",
"description": "Expo Play Audio Stream module",
"main": "build/index.js",
"types": "build/index.d.ts",
Expand Down

0 comments on commit fe71346

Please sign in to comment.