‎2018-04-01 11:13 AM
I am trying to modify the SensorTile AudioLoop sample project to save the audio to an SD card, instead of sending it out to the audio DAC and USB. I have successfully managed to save some audio data to the SD card, but the quality is not great. Please see the attached .wav file oh my trying to speak 'this is a test'.
Any audio pros have any idea what is missing?
I created the attached audio file by loading the saved PDM file from SD card to Audacity. I loaded it as 'raw' format, mono, 16 bit frames, and about 30kHz sample rate.
#stm32-audio-framework #audio #mems-microphone‎2018-04-03 08:02 PM
Well, it turns out that the above problematic audio clip is the results of saving off half the data.
PCM_Buffer is an array of uint16_t oflength AUDIO_IN_BUF_LEN. I was sendingAUDIO_IN_BUF_LEN number of elements of PCM_Buffer toDATALOG_SD_writeBuf(), but I casted PCM_Buffer as char first. Therefore, I was sending 8bit elements, not 16bit. Half my data was gone.
I was able to fix that and now the quality is better. However, there still is very clear interfearance. Interestingly, it's only when there is no silence.
Please listen to Audio_wav. Any suggestions are welcome.
________________ Attachments : Audio_001.wav : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hxqa&d=%2Fa%2F0X0000000b1M%2FABUsXOdYrfX2E.B_qaYmusO6cvQhT0M2s9TInq.LR64&asPdf=false‎2019-01-17 06:10 AM
Hi Norman,
It seems that we have exactly the same problem. Did you manage to solve it? How did you cut off the noise? What configuration for channels and filters did you use?
‎2019-01-17 06:22 AM
Hi!,
Initially my problem was caused by a bug in code that was simply dropping bits data. That was an easy fix.
However, in the end, I still got significant clipping sound in the audio. I played with the buffer length, which did change how the sound artifact appeared in the clip, however, it never went away.
If I was to try to solve this problem again, I would look at two things:
‎2019-01-17 10:23 PM
Thank you for reply. I will try to play with SD card service. I'll share results if I manage to make the record to sound clean.
‎2019-01-17 11:29 PM
You were right, I was writing not enough data to SD card. It turned out that half of data was cut off. After tune the SD service up my record sound as expected. Thanks a lot Norman for pointing me out the direction of investigation. =)