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
539 stars 107 forks source link

SwiftAudioPlayer without pods? #185

Open ideategames opened 1 week ago

ideategames commented 1 week ago

Your SwiftAudioPlayer is exactly what I need for a player of complex sound files. They are very large (>1GB) wav files, and streaming with AVPlayer or AVAudioPlayer don't cut it.

I am a novice in Swift but a programmer for many years. My problem is that I use a framework (Solar2d) and I cannot get the integration with pods to work. Someone in a forum wrote that it can work, but he forgot how he did it. Always The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation. And then /Users/Shared/Mobile/SScapeN2/ios/SwSound.swift:10:8 No such module 'SwiftAudioPlayer' I have tried everything I have seen on in other forums (updates, clean, etc), nothing fixes these. I do get a 'warning' that seems fixable, but I haven't figured it out. pod install says "include the Target Support Files/Pods-SoundScape/Pods-SoundScape.release.xcconfig in your build configuration (CoronaApp.xcconfig)."

I was just wondering if it is possible to just add the SwiftAudioPlayer swift files into the project, make it simpler. But then, which files?

Sorry I am so ignorant in this, just running in circles.

ideategames commented 1 week ago

I learned to bypass pod, very simply by adding package dependency. All looks good, now trying it. The biggest problem I have is the delay for playing a very large (>1.5GB) wav file. I am looking for a solution that can do this. I know it can be done because Solar2d does it, but Solar2d does not allow me to play when the app is not the current app (background).

My mistake (earlier version of this) -- it starts right away and streams the very large wav file. However, it often plays in bursts, not always. Maybe just my network? Is there a setting to fix that, such as starting the streaming but delaying the playback?

often it has this error soon after starting: Task <53AEFCA4-1F8E-4666-B559-879C5EF79EAF>.<2> finished with error [-997] Error Domain=NSURLErrorDomain Code=-997 "Lost connection to background transfer service" UserInfo={NSErrorFailingURLStringKey=https://...@ideategames.org/soundscape/....wav, NSErrorFailingURLKey=https://...@ideategames.org/soundscape/....wav, _NSURLErrorRelatedURLSessionTaskErrorKey=(

Then the sound cuts off about 20 seconds later. Any help or insight would be greatly appreciated.