Hi,
I'm a new programmer and I'm looking for some help.
Here is my problem. I need to detect peaks in a live audio from a pickup microphone and output the exact time to milliseconds or preferably nanoseconds of the peak in a .txt file.
I have been looking at two possible solutions. The first one was to set up a shell script in linux to record audio increments of 5 seconds via the nohup function and then analyze them in matlab, but the problem here is that the endings and the beginnings of the recorded files are not exactly 5 seconds apart. There is a delay of 50-150 milliseconds when a new file starts recording.
The second option was to do something similar to what they use for clap light switches, but I have no idea how I would extract the exact time from that. And I also don't know if that would work with a pickup microphone or does it just work with a sound sensor (for Arduino...) like it is shown here.
http://en.code-bude.net/2014/12/08/how-to-build-a-clap-switch-using-arduino/
I want to know if there is a better solution out there. Can I do this in C++ or java, perhaps? Remember, I need to output the exact time in milli- or nanoseconds.
Thank you guys, much help is appreciated.