audiokit

AudioKit Lifecyle confusion

ⅰ亾dé卋堺 提交于 2019-12-11 10:16:15
问题 I can't wrap my head around this. I read everywhere (rightly) that Audiokit lifecyle should be managed in a singleton and kept away from the View Controllers lifecyle. Then I checked all the example project's code and found a bit confusing that AudioKit.start() is always called in ViewDidload . But anyway thats not my real issue.. I have multiple ViewControllers that uses the AKMicrophone in a different way. For instance they need different categories, different AKSettings, and some must be

AudioKit: Noise gate

人走茶凉 提交于 2019-12-11 03:09:40
问题 I'm trying to implement a simple noise gate if the amplitude is beyond a certain threshold using AudioKit . I believe this should be simple and I just need to use the AKAmplitudeTracker and set the output to zero, but I can't work out how to do the latter part. Source for AKAmplitudeTracker 回答1: If I understand your question, you don't know how to set the output to zero. I'll go ahead and write the most obvious answer first, send the output through a booster, ...tracker stuff... let booster =

AudioKit 4.0.1 - Value of type 'AKSequencer' has no member 'avTracks'

会有一股神秘感。 提交于 2019-12-11 02:43:12
问题 My app has stopped working after recent upgrade of AudioKit from 3.7.1 to 4.0.1. Here is my code: sequencer = AKSequencer(filename: myMidi) for i in 0..<popCount { //start Audio sequencer!.avTracks[i].destinationAudioUnit = gPOPs[i].samplePlayer.samplerUnit } And here is the error message I get: Value of type ' AKSequencer ' has no member ' avTracks ' Just wondering if anyone can help me with understanding what has changed and how I can fix it. EDIT Also tried: sequencer!.tracks[i]

Swift AudioKit: How to build an VCO who's pitch is controlled by an AR-envelope?

旧城冷巷雨未停 提交于 2019-12-11 02:19:24
问题 I am new to AudioKit. I want to build an VCO who's pitch is controlled by a re-triggerable A(H)R-envelope (with adjustable attenuation) and I am looking for the best or most common way to do it. After some research (and wrong directions) it looks to me that I have to go with AKOperationGenerator and AKOperation. Best example to follow was the Filter Envelope example from the playgrounds. I tried: enum PitchEnvVCOSynthParameter: Int { case frequency, decayTime, gate } struct PitchEnvVCO {

AKAudioPlayer: No sound in speakers, only with headphones

谁都会走 提交于 2019-12-11 00:26:01
问题 Using AudioKit for sound management, I noticed an issue (bug?) with this very simple piece of code. import AudioKit class MainViewController: UIViewController { var audioFile: AKAudioFile? var audioPlayer: AKAudioPlayer? override func viewDidLoad() { super.viewDidLoad() } @IBAction func onPlayButtonClick(_ sender: Any) { do { audioFile = try AKAudioFile(forReading: Bundle.main.url(forResource: "3e", withExtension: "mp3")!) audioPlayer = try AKAudioPlayer(file: audioFile!) AudioKit.output =

iOS: How to play audio without fps drops?

你离开我真会死。 提交于 2019-12-10 23:39:57
问题 I am in the process of developing a game for iOS 9+ using Sprite Kit and preferably using Swift libraries. Currently I'm using a Singleton where I preload my audio files, each connected to a separate instance of AVAudioPlayer. Here's a short code-snipped to get the idea: import SpriteKit import AudioToolbox import AVFoundation class AudioEngine { static let sharedInstance = AudioEngine() internal var sfxPing: AVAudioPlayer private init() { self.sfxPing = AVAudioPlayer() if let path = NSBundle

AudioKit - Temporary file size is too big

白昼怎懂夜的黑 提交于 2019-12-10 19:43:36
问题 I am using AudioKit's AKNodeRecorder for recording audio. While recording audio it generates CAF file in a temp directory. if we save it with exportAsynchronously it creates a new file with m4a extension in document directory. The CAF file generates in temp directory is too big in size. 1 sec of audio takes 1 sec = 360000 bytes = 0.36 MB Disk space while after exporting m4a file takes 1 sec = 32000 bytes = 0.032 MB Disk space The m4a space is good for recording an audio. but the CAF file size

AudioKit: Can I disable an AKMicrophone without calling AudioKit.stop()?

萝らか妹 提交于 2019-12-10 18:28:53
问题 I've got an app with two features. One plays an AKMetronome and allows background playback when the app is not in the foreground. The other is a tuner feature which uses AKMicrophone , which only needs to be active when the app is in the foreground. These features can be used simultaneously (a blinking metronome light while the tuner is active). When I press the home button, the metronome keeps playing (as expected). But the active microphone for the tuner also causes the bright red

Referenced AudioKit framework is not recognized by XCode

怎甘沉沦 提交于 2019-12-10 14:33:40
问题 When I create a new XCode project that references (as opposed to CocoaPods, etc) one of the AudioKit frameworks, XCode does not autocomplete AudioKit declarations and explicitly declaring an AudioKit object (such as AKMIDISampler) results in a build error: 'AKMIDISampler' is unavailable: cannot find Swift declaration for this class. Typically the problem lies in correctly inputting the framework search paths in XCode. However, even though I put in a relative path to the framework for both my

How to get and save the mixed of multiple audios in to single audio in swift

折月煮酒 提交于 2019-12-10 11:48:08
问题 I have multiple audios files(more than 3). By using the AVAudioEngine and AVAudioMixerNode I am playing the all audio tracks into a single track. I want to save the mixed audio in the document directory. Give suggestions to mix the multiple audios files and save in a document directory. Thank you 回答1: Try this: func mergeAudioFiles(files: [URL], completion: @escaping (_ succeeded: Bool)->()) { let composition = AVMutableComposition() guard let compositionAudioTrack:AVMutableCompositionTrack =