Comments (7)
You first Band Pass filter the data and then measure the volume of the new data? I don't see the problem?
from nvdsp.
Would that work to find the volume of each band? That is if I had 10 bands then I want 10 volumes returned back. By filtering the data you wouldn't have the original anymore and in order to get the volume of each you would have to copy that original data 10 times.
Is there away around that?
from nvdsp.
I guess you're then looking for a spectrum analyser, which can be done with a FFT algorithm. This has not been implemented in NVDSP.
Have you tried copying the data 10 times? They're small buffers anyway and if you measure one band at a time you can free the copied data immediately when you have the volume.
from nvdsp.
Hi Bart,
Hope you would be doing well. Thanks a lot for your support and co-ordination, I really appreciate that. Currently I am working on reverb and echo effect on an audio file. I have read your comments on this issue and tried the Novocaine's sample code in order to achieve a simple delayed effect to mimic echo. I am facing a problem in that there is too much noise. I know I would be doing something wrong so I am sharing my code here with you so you may kindly review it and point out my mistake.
[self.fileReader setReaderBlock:^(float *data, UInt32 numFrames, UInt32 numChannels) {
wself.ringBuffer->AddNewInterleavedFloatData(data, numFrames, numChannels);
}];
[self.fileReader play];
self.fileReader.currentTime = 0.0;
//int echoDelay = 11025;
//float *holdingBuffer = (float *)calloc(16384, sizeof(float));
[self.audioManager setOutputBlock:^(float *outData, UInt32 numFrames, UInt32 numChannels) {
//[wself.fileReader retrieveFreshAudio:outData numFrames:numFrames numChannels:numChannels];
//Grab the play-through audio
wself.ringBuffer->FetchInterleavedData(outData, numFrames, numChannels);
float volume = 0.8;
vDSP_vsmul(outData, 1, &volume, outData, 1, numFrames*numChannels);
//Seek back, and grab some delayed audio
wself.ringBuffer->SeekReadHeadPosition(5);
//wself.ringBuffer->FetchInterleavedData(holdingBuffer, numFrames, numChannels);
//wself.ringBuffer->SeekReadHeadPosition(echoDelay);
volume = 0.5;
//vDSP_vsmul(holdingBuffer, 1, &volume, holdingBuffer, 1, numFrames*numChannels);
//vDSP_vadd(holdingBuffer, 1, outData, 1, outData, 1, numFrames*numChannels);
}];
from nvdsp.
Hi @faizankhan1909, thank you for the kind words. First of of all, your code currently has the delay parts commented out, so I think you mean that it makes noise when you actually turn it on?
The first thing I noticed is that you combine a 80% volume and 50% volume channel. This results into 130% which is higher than the allowed 100%. What this means is that if the fetched data contains samples that hit the 1.0f (or -1.0f) mark, you will send out something like 0.8 * 1.0f + 0.5 * 1.0f = 1.3f. Samples above 1.0f or below -1.0f will clip horribly, so that' d generate a lot of noise.
I recommend you try to set volume = 0.2;
for the delay instead of the 0.5
right now. If this solves it, that means it was the clipping.
Something else I can think of is that you might need to set the ReadHeadPosition of the ringBuffer back after you grab some delayed audio, but it seems you were already thinking about that. Let me know if this works for you.
from nvdsp.
Hi @bartolsthoorn,
Thank you for the quick response. Sorry I could not reply earlier, as I was too much indulged in some project. Just wanted to tell you that your solution worked perfectly fine. And now there is no noise, furthermore the delayed samples are giving the impact of a surround sound that I wanted to achieve. Thank you once again :)
from nvdsp.
@faizankhan1909 Thanks, that's nice to hear! 👍
from nvdsp.
Related Issues (20)
- How to make custom audio EQ HOT 1
- Can we save audio file after applying filters? HOT 1
- Possible bug in NVDSP.mm when copying the results back to audio buffer HOT 4
- Thread safety and efficiency HOT 11
- 3-band EQ HOT 1
- Support with AVPlayer and AVAudioPlayer HOT 1
- Some Interruption when the app go to background HOT 3
- How to filter audio that is hosted on server HOT 3
- How to implement bass boost using high pass filter? any idea? HOT 3
- Issue with headphones HOT 1
- No tag 0.0.1 HOT 1
- Fail compile HOT 1
- No tag v0.0.1 HOT 1
- RingBuffer HOT 2
- Feed it the next song... HOT 8
- How to get audio data to use from microphone. HOT 1
- can i use directly with lib `FreeStreamer` to process audio HOT 7
- BandPass filter help HOT 1
- who can help me to build a 10-band-eq example?
- Is there anyway to use NVDSP in Swift?
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 nvdsp.