cancel
Showing results for 
Search instead for 
Did you mean: 

FAD903D volume control

shiva_shankar_e
Associate III

hi community 

i am using  "AEK-AUD-C1D9031"  board. in this board i had flashed  .WAV files and i had played. the wave files are played using an example code given in the autodevkit. i used an API playsound() this one will give good sound when i had used playsoundwithgain() -> the gain with range (15,17) the sound quality was good with decent amount of volume. but hear i want to control the volume  (0db - 75db),but by using playsound() and playsoundwithgain() i am unable to control the volume( the sound will be very noise when i had used gain in range of ( (0-14) and (17- so...on) ). so is there any alternatives to control the volume of the sound.

 

hear is the pic of the function which i had used.image.png

1 ACCEPTED SOLUTION
5 REPLIES 5
AbrahamIsaac
Associate II

The noise in your AEK-AUD-C1D9031 board happens because playSoundWithGain() just multiplies samples by 2 in a simple loop. That's why it only sounds "clean" in tiny 15-17 window.

AbrahamIsaac_0-1770137260330.png

 

this example code you shared isn't designed for linear 0-75db control.
It actually skips samples to change speed and uses discrete steps that break the audio quality outside those fixed ranges.

hope you are able to understand & able to fix it out now. 

Hi,

Your description is correct. The purpose is to use a low cost MCU for this application without using an equalizer 0-75db that would require an audio processor.

If you have an idea to improve the sound quality by using the same low cost MCU, please post your suggestion.

Best Regards,

AutoDevKit Team

loveforcircuits
Associate III

The AEK-AUD-C1D9031 includes an audio codec + amplifier stage. These usually have DAC output volume registers, headphone/line-out analog gain control, speaker amplifier gain control

 

Hi,

No! There is no codec implemented in the MCU! Only a digital streaming to the Audio AMP.

Again, this is a low-cost version of the full audio application.

Best Regards,

AutoDevKit Team