Open dodgekaze opened 2 months ago
Thank you for keeping track of your progress here, seems like you are on the right track. It'll probably just require a couple more rounds of experimentation and going over the datasheet, pay special attention to the data format. Big endian or little endian is a pain, and 24 bit samples come in all kinds of varieties so they are even worse. Also i2s transport mono/stereo and things like that have to be taken into account. I can definitely accept a PR when you get this working!
@biemster
The datasheet contains the following info:
The SPH0645LM4H microphone operates as an I2S slave. The master must provide the BCLK and WS signals. The Over Sampling Rate is fixed at 64 therefore the WS signal must be BCLK/64 and synchronized to the BCLK. Clock frequencies from 2.048Mhz to 4.096MHz are supported so sampling rates from 32KHz to 64KHz can be had by changing the clock frequency. The Data Format is I2S, 24 bit, 2’s compliment, MSB first. The Data Precision is 18 bits, unused bits are zeros.
I have tried changing the rate to 32000 and using the following command, but still no luck
ffmpeg -f s24be -ar 32000 -ac 1 -i data.bin output.wav
Would appreciate if you can help me in the right direction!
It's very difficult for me to give some pointers without having the device on hand. But seeing it's from adafruit it must have some support community around it, I'd suggest to take your question there?
@biemster I appreciate your response! I will have a look there. Just to verify you used this one if I'm correct? https://www.tinytronics.nl/en/sensors/sound/inmp441-mems-microphone-i2s
I might order this one to see if it works.
@biemster I appreciate your response! I will have a look there. Just to verify you used this one if I'm correct? https://www.tinytronics.nl/en/sensors/sound/inmp441-mems-microphone-i2s
I might order this one to see if it works.
Die lijken heel veel op wat ik had besteld, ik heb ze hier vandaan: https://www.aliexpress.com/item/32960945048.html Je kan de middle man er tussen uit halen als je een maandje kan wachten, maar de tinytronics zijn hoogstwaarschijnlijk dezelfde.
@biemster I appreciate your response! I will have a look there. Just to verify you used this one if I'm correct? https://www.tinytronics.nl/en/sensors/sound/inmp441-mems-microphone-i2s I might order this one to see if it works.
Die lijken heel veel op wat ik had besteld, ik heb ze hier vandaan: https://www.aliexpress.com/item/32960945048.html Je kan de middle man er tussen uit halen als je een maandje kan wachten, maar de tinytronics zijn hoogstwaarschijnlijk dezelfde.
Bedankt! Ik heb die van Tinytronics besteld. Hopen dat daar direct wat bruikbare data uitkomt zodat ik verder kan gaan met PCM data gebruiken voor tone recognition (matchen van een toon / patroon met het ander) vervolgens zal ik weer terug gaan naar de SPH0645LM4H. Ik vermoed zoals je aangaf dat het o.a om de verschillende sampling rate / data format gaat van de SPH0645LM4H.
I'm trying to read data from the SPH0645LM4H.
The output received is :
However when I transfer this into a bin file:
and then use the following to convert it to .wav I only hear static / no sound... Does my initial data in hexadecimal look fine?
ffmpeg -f s32be -ar 16000 -ac 1 -i data.bin output.wav
Microphone used: https://learn.adafruit.com/adafruit-i2s-mems-microphone-breakout/overview
Code: