Comments (4)
@AttilaTheFun Hey! This came across my email so I daydreamed about it while walking my dog. AudioKit may not currently have a solution, but here are some thoughts for putting one together:
If you find the function in AudioKit: loadAudioSignal(audioURL: URL) -> (signal: [Float], rate: Double, frameCount: Int)?
This will return for you an array of floating point values (signal) for a given audio file (as well as the sample rate and number of samples).
As far as combining lossless files go, we can think of it as simply adding the samples together. Assuming the sample rates of your two (or more) files are the same, then all you need to do is:
- loop for the longest sample count
- add all the existing samples from the audio files together at that index/frame
- hard clip / clamp to the min/max [probably just -1.0 / 1.0]
Then you will be left with a resulting floating point array with an associated sample rate (same from before) - I imagine that you could google your way to flipping that into an audio file from there 🙂
from cookbook.
AudioKit doesn't have too much to do with audio file creation, besides recording. It would be a nice addition. It's not really a Cookbook issue though, since if it's not part of AudioKit it can't be in the Cookbook, so I will close this here.
from cookbook.
@AttilaTheFun Things get more complicated if the sample rates are not the same. I can imagine then the solution would look like resampling any audio file that is not at whatever your desired output sample rate would be before doing the loop/arithmetic.
Even still, it probably wouldn't be that bad. I think there are some Accelerate functions for performing this sort of resampling for you.
from cookbook.
Awesome, I'll see if I can get that working this weekend! 😊
from cookbook.
Related Issues (20)
- Missing package product 'CookbookCommon' HOT 3
- Cookbook no longer runs xcode 14 HOT 1
- Tuner not producing output values HOT 1
- Recommend moving that "work in progress" roland filter emulation to the "work in progress" folder. Can also replace that with a VCS3 filter instead. HOT 1
- Could you Solve this problem?? We don't know Which is the problem of EXS file Or the problem of "SampleManager.cpp:440" ?? HOT 1
- CookBook package resolution does not work in Xcode 13 HOT 3
- ADD MIDI CONTROL OUT EXAMPLE HOT 4
- Does Audiokit provide any functionalites to play audio from NSData HOT 3
- Cookbook does not build in Xcode 15 beta 2 HOT 2
- Crash when going back from Mini App / Drum Sequencer without stopping
- Error in CompletionHandlerConductor file. HOT 2
- New addition HOT 1
- Mac Catalyst target build fails HOT 3
- Telephone Example: Text cannot be deleted. Uneven button layout.
- Engine stopped when going from Bluetooth audio route to Multi Segment Player
- Bluetooth headphone support
- Build failed due to 'Keyboard' package HOT 4
- Missing required module 'CAudioKitEX' in Previews HOT 1
- Piano doesn't sound as before HOT 4
- GraphicEqualizer example appears to be non-functional
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cookbook.