Go Down

Topic: Cheap way to produce sound effects? (Read 265 times) previous topic - next topic

Jonathanese

I'm creating a wifi sound effects controller using the nodeMCU, SD card reader, and some sort of audio output system.

I've read a few ways of producing sound from the nodeMCU, and wanted to know your thoughts on a good method/parts. I've been looking up DAC chips on Digikey although if they have a single-chip DAC and Amplifier that would be even better.

Basically, I don't need much below the 1-2kHz range. but I want enough volume for things like birds chirping, crickets, and maybe water. I'm not too worried about flat response, either. My dad has a pro audio spectrum analyzer and I figure I'll use that to create an inverted image of the response, which I will run my audio through before uploading it to the SD card. So I would say 12-16 bits at 44100 should be enough.


The big thing is a tiny, but fairly loud speaker, and a DAC/amplifier that I can use. I keep my eye out, but I figure the Arduino community probably has a good pairing for this, such as for bluetooth speakers and the like.


DVDdoug

Look for an audio shield.   These things have a memory slot, a DAC & clock and everything to make sound (to make a sound signal) and some of them even have a built-in MP3 decoder.   So, the Arduino just acts as a controller.   They aren't exactly "cheap", but it's usually the best solution.

Quote
Basically, I don't need much below the 1-2kHz range...

 ...So I would say 12-16 bits at 44100 should be enough.
I'd say so...   16/44.1kHz is "CD quality" and it's better than human hearing.*    

BTW - A higher sample rate doesn't help with low  frequencies anyway.  The audio frequency can't go higher than half the sample rate (Nyquist theory, or you just need to realize that you need at least one sample for the top-half of the wave and one for the bottom-half).

Depending on the audio shield, you may need an amplifier to drive the speaker(s) or amplified speakers.   Although, with higher frequencies a piezo tweeter/transducer may work without an amplifier.  (They are higher impedance and require less current/power).

Quote
My dad has a pro audio spectrum analyzer and I figure I'll use that to create an inverted image of the response, which I will run my audio through before uploading it to the SD card.
The frequency response of the electronics should be fine (flat) but if you have a measurement microphone you may be able to make-up for some speaker variations (if that's important at all).





* The guys who do scientific-blind ABX Tests have pretty-much demonstrated that there is no audible difference between a high-resolution original and a copy downsampled to CD quality.   Sometimes an MP3 can sound identical to a high-resolution original. ...Then the "audiophiles" start telling you that there's something wrong with the test, or that blind listening tests are never valid, etc.  :D :D

Jonathanese

Cool stuff.

I suppose what would be nice is for the NodeMCU to still be able to access the SD card, since it will be used for other things as well.

"BTW - A higher sample rate doesn't help with low  frequencies anyway." lol yeah I know. Mentioning the 1-2kHz had more to do with the speaker. A 5W tweeter would be insane. A 5W woofer would be barely audible.

As far as sample resolution, 12 bits should be plenty but I worry 8 bits would be pushing it. 16/44.1 is about as widely available as you can possibly get, though.

I *might* be okay going down in sample rate, too. Maybe a 32k minimum so that I can still get my 16k's and then run a low pass to prevent aliasing.


"if you have a measurement microphone you may be able to make-up for some speaker variations (if that's important at all)."

Yup, that's the idea. I want to practically feels those crickets hopping on me.




I've been keeping an eye out, and I'm seeing surface-mount speakers used in things like cell phones (though it may be the earpiece and not the loudspeaker). Looking at the options for managing the sound, I might be SOL unless I want to add a RAM chip to the NodeMCU to use as an audio buffer. I like the idea of playing directly using an addressable codec chip, but it seems like that would prevent me from using the SD card for things like a config.ini and image-based LED animations.


Go Up