我打算在我的iOS应用程序中重构我的录音系统.背景:到目前为止,我分别录制视频和音频,同时开始大致录制.一旦完成记录,同样的系统,我分别播放视频和音频,在音频上动态应用AudioUnits.最后,我合并了视频和修改过的音频.碰巧两个记录不会同时启动(出于任何原因),从而产生不同步的结果.
是否可以像这样重构我的系统:
1) Record normal video with audio into mov file --> I would be sure that audio+video would be synchronized.
2) During viewing the result with AVPlayer, process the audio part on the fly. (I will use AudioKit) --> that's the part I m not confident.
Would I be able to send the audio buffer to Audiokit (which would process it) and give back the processed audio to AVPlayer like if it was the original AVPlayer audio part?
3) …Run Code Online (Sandbox Code Playgroud) 这与GitHub AudioKit有关!
我想知道是否有一种方法可以将本地存储的音频文件的音量增加到默认音量(1.0)以上
看一些示例代码:
let metronome = AKSamplerMetronome()
let file = Bundle.main.url(forResource: "filename", withExtension: "wav")
metronome.sound = file
metronome.volume = 1.0 // How to volume boost on local file called "filename.wav"?
metronome.play()
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激!提前致谢 :)
我想知道如何来控制AKOscillator使用的频率AKSequencer,但是几个例子(1,2)我在网上看到只显示了如何控制一个AKSampler用AKSequencer.
这是AudioKit的GitHub页面的简化示例:
// relevant class properties
var seq: AKSequencer?
var syn1 = AKSampler()
// viewDidLoad
seq = AKSequencer(filename: "seqDemo", engine: AudioKit.engine)
seq?.enableLooping()
seq!.avTracks[1].destinationAudioUnit = syn1.samplerUnit
Run Code Online (Sandbox Code Playgroud)
我的期望:
基于上面的例子,我希望能够做到这样的事情:
var voice1 = Voice() // replaces the AKSampler
seq = AKSequencer(filename: "seqDemo", engine: AudioKit.engine)
seq.loopOn()
//seq.avTracks[0].destinationAudioUnit = voice1.oscillator.avAudioNode
seq.note = voice1.oscillator.frequency // "note" doesn't actually exist in the API
Run Code Online (Sandbox Code Playgroud)
这显然没有做到这一点.
什么是允许我使用AKSequencer控制AKOscillator的正确设置?
我正在构建一个应用程序,允许用户将音频过滤器应用于录制的音频,例如Reverb,Boost.
我无法找到有关如何将过滤器应用于文件本身的任何可行信息来源,因为以后需要将处理后的文件上传到服务器.
我目前正在使用AudioKit进行可视化,我知道它能够进行音频处理,但仅限于播放.请提供任何进一步研究的建议.
我需要做什么:
我是音频编程的新手,但据我所知,到目前为止我需要" 全通 "滤镜(如果不是请纠正我).
为了完成这项任务,我发现了两个库:Novocaine和AudioKit,但用C语言写的Novocaine,所以在swift中实现它更难,我决定使用AudioKit,但我没有在那里找到"All Pass"过滤器.
有人知道如何在AudioKit中实现它并保存过滤后的文件吗?谢谢!
我正在尝试AudioKit将麦克风通过管道传输到Google的语音文本API,如此处所示,但我不确定如何解决。
要为语音转文本引擎准备音频,您需要设置编码并将其作为块传递。在Google使用的示例中,他们使用了Apple的示例AVFoundation,但是我想使用AudioKit,这样我就可以进行一些预处理,例如削减低振幅等。
我相信执行此操作的正确方法是使用Tap:
首先,我应该通过以下方式匹配格式:
var asbd = AudioStreamBasicDescription()
asbd.mSampleRate = 16000.0
asbd.mFormatID = kAudioFormatLinearPCM
asbd.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked
asbd.mBytesPerPacket = 2
asbd.mFramesPerPacket = 1
asbd.mBytesPerFrame = 2
asbd.mChannelsPerFrame = 1
asbd.mBitsPerChannel = 16
AudioKit.format = AVAudioFormat(streamDescription: &asbd)!
Run Code Online (Sandbox Code Playgroud)
然后创建一个水龙头,例如:
open class TestTap {
internal let bufferSize: UInt32 = 1_024
@objc public init(_ input: AKNode?) {
input?.avAudioNode.installTap(onBus: 0, bufferSize: bufferSize, format: AudioKit.format) { buffer, _ in
// do work here
}
}
} …Run Code Online (Sandbox Code Playgroud) 目前我正在使用一个AKKeyboardView基本上连接到AKRhodesPiano对象,我想知道是否有一个简单的方法来生成一个MIDI文件?
我看到AKKeyboardView有noteOn和noteOff函数,它确实产生了MIDINoteNumber但是我找不到AudioKit库中的任何其他地方来真正接受这个输入并生成一个MIDI文件,即使只是一个简单的文件.
我希望有人能在这里帮助我。我正在尝试进行基本的录音设置,但 AudioKit 正在崩溃,我确定这是我的错,我没有做正确的事情。这是我的设置。在我中,viewDidLoad我像这样配置 AudioKit:
// Session settings
do {
AKSettings.bufferLength = .short
try AKSettings.setSession(category: .playAndRecord, with: .allowBluetoothA2DP)
} catch {
AKLog("Could not set session category.")
}
AKSettings.defaultToSpeaker = true
// Setup the microphone
micMixer = AKMixer(mic)
micBooster = AKBooster(micMixer)
// Load the test player
let path = Bundle.main.path(forResource: "audio1", ofType: ".wav")
let url = URL(fileURLWithPath: path!)
testPlayer = AKPlayer(url: url)
testPlayer?.isLooping = true
// Setup the test mixer
testMixer = AKMixer(testPlayer)
// Pass the output from the player …Run Code Online (Sandbox Code Playgroud) 我有一个相当复杂的应用程序,到目前为止一直在使用 AKAppleSequencer,但由于该定序器时不时出现一些奇怪的行为和错误,我一直希望迁移到较新的 AKSequencer。不幸的是,新的音序器似乎没有在 Playgrounds 或太多文档中出现,所以我一直在做一些猜测。我以一种似乎有意义的方式(对我来说)将所有内容连接起来,并且正如我所提到的,使用 AKAppleSequencer 可以正常工作,但是使用 AKSequencer 可以运行,但不会产生任何输出。
我的代码结构被分解为多个部分,因此节点图在不同的位置构建,因此我必须在此处以块的形式显示它,并删除不相关的行。
// This happens during setup
mainMixer = AKMixer()
mainMixer.volume = volume
AudioKit.output = mainMixer
// In later code, the sequencer is constructed
sequencer = AKSequencer()
sequencer!.tempo = tempo
// After the sequencer is created, I create various nodes and tracks, like this
let trackNode = trackDefinition.createNode()
let track = sequencer.addTrack(for: trackNode)
track >>> mainMixer
Run Code Online (Sandbox Code Playgroud)
那里有一条线,我在一个名为 trackDefinition 的东西上调用“createNode()”。我认为该类的详细信息与此处无关,但这里是该方法代码主体的示例。这非常简单。
func createNode() -> AKNode {
let pad = AKMIDISampler()
do {
try pad.loadSoundFont(partConfiguration.settings["soundFontName"]!, …Run Code Online (Sandbox Code Playgroud) 更新已经一年了,所以我昨天下载了 AudioKit 4.11.2。我构建了所有框架,包括 AudioKit 和 AudioKitUI xcframeworks。
然后我开始玩游乐场。Xcode 立即告诉我构建失败,因为它找不到 AudioKit 框架。原始项目文件中设置的搜索路径似乎需要调整,所以我将其设置为“$(inherited)../Frameworks”。
现在它构建但仍然不会运行,在import AudioKitPlaygrounds声明中说有No such module AudioKitPlaygrounds.
奇怪,因为这是构建的目标,它存在于派生数据产品文件夹中。
通过 StackOverflow 搜索显示,AudioKit 过去也遇到过类似的问题,但提出的解决方案似乎都与我的情况无关。
让 Playgrounds 运行还需要哪些其他技巧?难道它不应该在不干扰项目搜索路径的情况下直接构建和运行吗?
我的环境是:macOS 10.15.6 MacBookPro Xcode 12.0.1