Audiokit trim audio

风流意气都作罢 提交于 2021-02-19 05:46:05

问题


I'm making audio editing app, and I want trim my audio. For audio editing I use AudioKit framework. But I can't find in tutorials, and examples, how I can trim audio using this framework?


回答1:


Export asynchronously allows for setting the start and end samples:

https://github.com/AudioKit/AudioKit/blob/master/AudioKit/Common/Internals/Audio%20File/AKAudioFile%2BProcessingAsynchronously.swift#L267

/// Exports Asynchronously to a new AKAudiofile with trimming options.
///
...
///   - fromSample: start range in samples
///   - toSample: end range time in samples
...
public func exportAsynchronously(name: String,
                                 baseDir: BaseDirectory,
                                 exportFormat: ExportFormat,
                                 fromSample: Int64 = 0,
                                 toSample: Int64 = 0,
                                 callback: @escaping AsyncProcessCallback) {
    let fromFileExt = fileExt.lowercased()


来源:https://stackoverflow.com/questions/52060593/audiokit-trim-audio

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!