tanhakabir / SwiftAudioPlayer

Streaming and realtime audio manipulation with AVAudioEngine
https://medium.com/chameleon-podcast/creating-an-advanced-streaming-audio-engine-for-ios-9fbc7aef4115
MIT License
546 stars 108 forks source link

Bug fix for resetting cache #137

Closed Husseinhj closed 2 years ago

Husseinhj commented 2 years ago

After a user has called clear on AudioClockDirector, the cache will be reset

Problem:

In the case of playing multiple audio files and choosing another audio in the middle of the first file, the SAPlayer.Updates.ElapsedTime.subscribe will be called half played files elapsed by the number of items in the cache. By calling AudioClockDirector.shared.clear() inside the handleClear() method of the SAPlayerPresenter class. If the SAPlayer.shared.clear() method is called, the cache will be cleared.

tanhakabir commented 2 years ago

This isn't the best solution since it forces everyone to unsubscribe including other layers of the app outside of this library. I'll create an issue for the caching problem and put the denoising lower down

tanhakabir commented 2 years ago

Fixed in version 7.0.1: https://github.com/tanhakabir/SwiftAudioPlayer/pull/141