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

Change audio file download location #138

Open ericrohlman opened 2 years ago

ericrohlman commented 2 years ago

Add the ability to alter the remote audio file download location.

Default location is the user's documents directory.

tanhakabir commented 2 years ago

Created an experimental entrympoint to set download location through SAPlayer.Downloader.downloadDirectory. I didn't well test this but I recommend setting the directory before performing any downloads. Also it could be difficult to retrieve files if you forget which directory you saved it in (I haven't added anything to search all your files).

When you download a file you get the url of where it was saved back, I recommend saving that for good measure if you're going to be messing around with directories.

ericrohlman commented 2 years ago

Thanks for the reply! Excellent work on the player library. We are using it to play all of our audio files (offline and online) for the National Spelling Bee iOS app.

Ended up just keeping them in the Documents directory, mark the URL with a no-backup, and then just filter the files with 'mp3' filetypes when a user clears the audio cache?

You cool with us adding an acknowledgment in our upcoming release? New release should be week of 8/23. https://apps.apple.com/us/app/word-club-spelling-vocabulary/id1479862742

tanhakabir commented 2 years ago

Woah very cool! Yes of course! I appreciate the shoutout 😊