Audiokit trim audio
Asked Answered
S

1

2

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?

Snazzy answered 28/8, 2018 at 14:43 Comment(0)
S
3

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()
Sucrase answered 28/8, 2018 at 16:47 Comment(2)
Thank you! That's what I was looking for.Snazzy
exportAsynchronously it's not supported in AudioKit 5Lina

© 2022 - 2024 — McMap. All rights reserved.