None Micro SD audio playback

Ghostbear

Member
Evening everyone.

I'm working on a project that essentially replicates a PPG Pistol from Babylon 5 for a costume. The only thing I'm currently scratching my head over is the sound playback 0 I;ve got a version working using SD audio player, but what I'd like is a chip that can record two sound samples (short 1-2 seconds at top) and then playback either one depending on the signal/s sent to it. Essentially the reload/charge noise, then the shot noise.

I'm also trying to keep it as physically small as possible without going into surface mount

anyone have any suggestions?
 

MFB

Senior Member
I remember sampling audio clips with microcomputers decades ago and, proving the input signal level was set to get the best resolution from an ADC, it was possible to get reasonable quality speech playback. Therefore, it should be possible to sample the sound effects you require using a PICAXE ADC, store the 8-bit data on an EEPROM and play it back via a DAC. That is of course if you don't want to use a dedicated speech recorder chip.
 

Rick100

Senior Member
Hello Ghostbear,

You can play raw sound files with a Picaxe 20X2 running at 64MHz, and a 24fc256 seeprom. It will hold about 4.5 seconds of audio sampled at 7000 hertz. Here's an example:
https://youtu.be/RpQEtkKomCI
Here's the thread about it:
http://www.picaxeforum.co.uk/showthread.php?27408-PWM-music/page4
I started getting decent results in post 32.
You have to use a program like Audacity to sample your sounds. In the past I've used a homemade programmer to burn the seeprom chips, but now you can buy cheap programmers like this one:
https://www.banggood.com/CH341A-24-25-Series-EEPROM-Flash-BIOS-DVD-USB-Programmer-p-929338.html?rmmds=search&cur_warehouse=CN
If you need longer sound files and a higher sample rate, you can use a larger eeprom chip like the Winbond W25Q80. I used it in this project:
http://www.picaxeforum.co.uk/showthread.php?27506-Talking-Guess-the-Number-game
The CH341A programmer is supposed to support the winbond chips.

You'll still need an audio amplifier like this small one:
https://www.banggood.com/CJMCU-832-PAM8302-2_5W-Single-Channel-Class-D-Audio-Power-Amplifier-Development-Board-For-Arduino-p-1103106.html?rmmds=search&cur_warehouse=CN

I think some people use the sound recording birthday cards for sound effects but I think recording your sounds in Audacity gives you more control.

Good luck,
Rick
 

Ghostbear

Member
Thanks all :)

I've found a way to convert WAV files to 1 bit serial file, so I should be able to playback directly via the picaxe...

I think it'll need to go via ADC possibly to an amp.

Anyone have any experience of similar??
 

Rick100

Senior Member
That looks promising Rick. Have you been able to get it to store 2 different sound files, triggered separately?
The 'files' are just raw binary data stored in the seeprom chip. To play them you need to know their start address and length. So you can have as many sounds as you can fit in the seeprom. You can use Audacity to determine the start and end values. To play two different sounds, you could use two different input pins. A signal on the first pin would set the start address and length for the first sound and call the routine to play it. A signal on the second pin would set the start address and length for the second sound and call the routine to play it. Only one sound can be played at a time and the Picaxe can't do anything else while it's playing the sound.

I've found a way to convert WAV files to 1 bit serial file, so I should be able to playback directly via the picaxe...
Are you referring to the Roman Black project? I tried his method many years ago with a raw pick and never got acceptable results.

Good luck,
Rick
 

Ghostbear

Member
Hi Rick, yeah thats the one. though if it can't play the sound in the back ground, I'm kinda stuck with either using another picaxe dedicated to the sound, or just use a dfplayer sd card anyway as I need it to be able to do stuff at the same time the sound plays (In this case, emit a coded IR pulse for the "shot" as it's for an ir based range combat system for Live roleplay)
 

Jeff Haas

Senior Member
I vote for using the Picaxe as the brains and a specialized sfx playback unit for sounds. Then the Picaxe just tells the MP3 player to play the sound and goes back to running things. Much simpler to make work.
 
Top