Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
davepusey said:Is it possible to save a WAV sound onto a pic and write a program that loops it when a specific input is high. The sound would have to be stored digitally in the EEPROM i suspect and use a DAC to output it. If it can be done i would like some help in doing it please.
davepusey said:The file is 0.877 seconds long. I've encoded it into a WAV as small as possible without losing quality and it is now 9,724 bytes at 11,025hz 8bit mono.
Exo said:What are you trying to do? This isn't really what a pic was meant to do, maybe there's a better solution
TKS said:if you use a MP3 file or midi file..!!
Matt(Pic progger) said::idea:
I have had a quick look at your code (in another thread), as you are only using a cheap 8ohm speaker job, why not resample the audio to a lower bitrate?
Matt(Pic progger) said:go and buy an alarm buzzer for £2.50ish from Maplin (<UK electonics shop).
Matt(Pic progger) said:Another "poormans" DAC can be made, with a saving on code space by shifting the data out of 1 pin, to a resistor/cap network, the more "1's" the voltage rises the more "0's" the voltage drops
davepusey said:Matt(Pic progger) said::idea:
I have had a quick look at your code (in another thread), as you are only using a cheap 8ohm speaker job, why not resample the audio to a lower bitrate?
Resampling to a lower bitrate causes sound to become distorted. I have it at the lowest i can get it.
quote]
I agree with Matt, I don't think reducing the sample rate would have any detrimental effect on the sound - it's basically only a 'beep' anyway 8)
Nigel Goodwin said:davepusey said:Matt(Pic progger) said::idea:
I have had a quick look at your code (in another thread), as you are only using a cheap 8ohm speaker job, why not resample the audio to a lower bitrate?
Resampling to a lower bitrate causes sound to become distorted. I have it at the lowest i can get it.
I agree with Matt, I don't think reducing the sample rate would have any detrimental effect on the sound - it's basically only a 'beep' anyway 8)
Well it aint just a beep. I will see if i can get it down any further with some tweaking. Also, i got that encoder to work. You have to go into pure dos (boot disk) to do it. Not dos within windows. But even with the encoder the code is far to long.
Exo said:Like i said before, 16F84 only has room for 1024 instructions...
7070 bytes would fit into a 16F876 with some thinkering, but then again, the 16F876 has enough pins to use external eeprom...