Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I was hoping I could recreate a noise cancelling set-up by recording sound from the microphone in my headset or from the computer and play it back in my speakers or headphones with the appropriate phase shifts (I understand it may not be a simple as that but it would be a start).

That is what I want to achieve, let's start with some small goals. Is it possible to record sounds automatically in Mathematica (or even in Mathematica for Rpi) ? I am familiar with SystemDialogInput

 SystemDialogInput["RecordSound"]

It pops a dialog which allows you to press a button to record a sound. However I can't seem to find an option, or maybe another way, to have the sound record automatically. So that this can automatically processed

share|improve this question
2  
Mathematica is not the right tool for real time applications. It doesn't give you guarantees for timings. I'm pretty sure this is not possible to do in real time with Mathematica. You can do it after the recording has been made, but not in real time. Even with other programs, latency is going to be a significant problem and might not be avoidable at all depending on your OS and audio driver. I have some experience with this trying to play on an external keyboard and generate sound with a computer. On our computer it was impossible even with an ASIO driver. –  Szabolcs Mar 21 at 17:55
1  
That said, here's something I got from dissecting that dialog: mathematica.stackexchange.com/a/20844/12 –  Szabolcs Mar 21 at 17:55
    
Of course when using professional sound cards it's possible to have very low latency with a supported ASIO driver, I was using asio4all on a laptop with integrated sound. –  Szabolcs Mar 21 at 18:00
    
@Szabolcs Thanks for the info. I tried a bit using your spelunking finds and got it to work at a rudimentary level, auto recording then playing with the sound. What kinda worse-case scenario problem could I expect from using these undocumented functions ? –  lalmei Apr 7 at 16:56
    
I really don't know. I guess you can crash the front end and lose work, crash the kernel, or cause a memory leak (probably in the front end). –  Szabolcs Apr 7 at 18:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.