Audiokit: Write audio file to disk with effects

Created on 9 Feb 2017  路  12Comments  路  Source: AudioKit/AudioKit

I'd like to open an audio file, and rather than just playback with a set of effects, also write this to disk (for future playback in a web browser etc). Is this possible? I can't see any examples.

enhancement

Most helpful comment

This is in the project list already. Should be relatively doable, just have to find the time.

All 12 comments

This is in the project list already. Should be relatively doable, just have to find the time.

@aure Ok. Is it something you need an in-depth knowledge of the framework for? I might be able to spend some time on it, if it's something that can be built with a few pointers in the right direction. I could do with it fairly soon which is why I'm asking (or any temporary workarounds you might have).

So, what I've been steering people to is the AudioKitTestSuite inside the iOS directory. This file rips through processing at at faster than real time. It could be the basis for writing the files. The trick would be that instead of processing an oscillator and saving the result to memory, you'd be processing a file and saving the result to disk. It would take some digging under the hood, not trivial, but doable as I said. I'll leave this issue open as a reminder.

@aure Cool I'll take a look at the tests. Thanks for leaving this open.

@tomw Any progress on this? I too need this feature for my project. Please let me know.

@namitgupta15 Not yet I'm afraid, I'm feeling like it's best to leave @aure to this as it doesn't sound like a minor change. Worth looking at the tests he suggests though.

Not a fix, but if offline processing is your only concern, you may want to look at Soundpipe, which many of the AK processing/synthesis is based off of. This library by default is compiled with libsndfile support, so you get audio file writing for free. In fact, all the soundpipe example code examples write to audio files by default.

There is also Sporth, built on top of Soundpipe, which provides a minimal language for audio processing. If you use AKOperation or AKOperationGenerator, it's pretty much Sporth under the hood.

But back to this issue at hand. I worked with Aure getting the test suite up and running, as they are built on top of the Soundpipe test suite utility. The AudioKit framework is built on a collection of apple audio utilities like coreaudio, which are designed and optimized for dealing with realtime audio streams. While AK has a lot of low level control over much of the DSP, the underlying graph model in charge of getting the stuff to the speakers is all Apple and out of our control. Polling the data from the AU graph AND doing it faster than realtime required placing many square pegs into round holes while fumbling in the dark. I'm still not entirely convinced we fixed all the strange race conditions we ran into, but the MD5s in the test suite work.

Offline rendering is being worked on by a new member of AudioKit's slack, so I'll invite anyone who wants to be involved to Slack, but I want to close this issue so I can just use the issue tracker on Github for fixable bugs, not enhancements.

How to join in your Slack. I too need this feature for my project

Also i need this feature for my project, i also want to join slack.

@aure Is it possible to write an audio file to disk w/effects (e.g. if you're putting the audio through some filters)?

@mdublin yes. Let's not glob this onto a closed issue though. Either contact me directly or ask a question through StackOverflow. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

trevor-sonic picture trevor-sonic  路  5Comments

NadirBertolasi picture NadirBertolasi  路  10Comments

blerchy picture blerchy  路  7Comments

gm3197 picture gm3197  路  10Comments

JerrySQian picture JerrySQian  路  6Comments