-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add AudioContext.createConvolver(), createBiquadFilter() & OfflineAudioContext bindings #1416
Comments
Probably gonna start this right after thanksgiving. Making some notes for myself.
|
Here are the various audio contexts. Do other objects in another comment.
|
Awesome, thanks for rounding up this info!
I agree we could pull in from LabSound, and it should work. There are mostly just hardware bindings that are not upstream (I think the generic buffer-based binding for Android), and buffering that was used for the deprecated ScriptProcessorNode. For most of the node types I mostly just created proxy objects for Javascript access which parallel the LabSound audio processing graph, without changing the LabSound code. The main difficulty in adding new node types is correct object linkage so that they are garbage collected at the right time.
|
Started on BiquadFilter. Question, it has both regular AudioParams and something probably requiring a fake, // License: BSD 2 Clause
// Copyright (C) 2011, Google Inc. All rights reserved.
// Copyright (C) 2015+, The LabSound Authors. All rights reserved.
#ifndef BiquadFilterNode_h
#define BiquadFilterNode_h
#include "LabSound/core/AudioBasicProcessorNode.h"
namespace lab {
class AudioParam;
class BiquadProcessor;
class BiquadFilterNode : public AudioBasicProcessorNode
{
BiquadProcessor * biquadProcessor();
public:
enum
{
LOWPASS = 0,
HIGHPASS = 1,
BANDPASS = 2,
LOWSHELF = 3,
HIGHSHELF = 4,
PEAKING = 5,
NOTCH = 6,
ALLPASS = 7
};
BiquadFilterNode();
unsigned short type();
void setType(unsigned short type);
std::shared_ptr<AudioParam> frequency();
std::shared_ptr<AudioParam> q();
std::shared_ptr<AudioParam> gain();
std::shared_ptr<AudioParam> detune();
// Get the magnitude and phase response of the filter at the given
// set of frequencies (in Hz). The phase response is in radians.
void getFrequencyResponse(ContextRenderLock&, const std::vector<float>& frequencyHz, std::vector<float>& magResponse, std::vector<float>& phaseResponse);
};
} // namespace lab
#endif // BiquadFilterNode_h |
Ok, I found an example of 2 type of these 'cons' in the Will pattern after that. |
Now looking where LabSound might do decoding. They have it in extended. Am noticing that the source files here are very different in both call syntax and # of lines. Your copy has 375 lines from 9/11/18. The current from Lab Sound has 108 lines from 7/4/19 & different calls. Think updating, your fork might be the next move. |
I am using FFmpeg for the decoding; is there some reason to change that? |
When I do a search of AudioContext.cpp, I do not get a hit for |
I think any sort of |
See this sound font I am using stores its data in js files for each instrument. There are multiple "files" within a font. Here is a piano. It uses that method. I will look around elsewhere in the project for where this is. |
Ok, it was not actually in C++, but in native-bindings.js. It works. Having a misunderstand & correcting is much preferred to having to write code! |
Went to add Constant Source Node, but found it wasn't actually implemented by LabSound. Edited table above to reflect. |
I am now doing quite a lot with WebAudio. The code base I was starting from is github.com/surikov/webaudiofont. It has constructed a node for reverb, which makes the sound seem bigger. (use the echo slider).
There does not appear to be bindings in exokit, but it is in the C code
The OfflineAudioContext is sort of nice to have, but it is also at the C level.
I might try to do this myself, but it you might make a few hints, it might be more doable.
The text was updated successfully, but these errors were encountered: