The Arduino I2S reference describes the I2S standard and functions available with the standard I2S library, (Bizarrely it doesn't reference the existing
read() function which is used in the examples but that is beside the point). There also exists an ArduinoSound library, however I have the same issue with this.
I would like to record audio from WM8731 connected up to Arduino. I am using an SAMD arduino part.
But, I have a tremendous issue with the
I2S.read() function. The
I2S.read() function only returns a singular value, however the I2S standard is intrinsically stereo.
This is particularly important for my project as I am only interested in the LEFT channel as the RIGHT channel is muted.
I would expect this to either:
- return a pair of values (i.e left /right) samples for that particular point in time , OR
- return a singular sample with extra information telling me which channel that is was retrieved from.
However it seems this is not the case. (Github)
I also assume that the I2S is buffered making it impossible to simply read the WS pin state, as I will probably be popping a sample from the buffer that was push into the buffer at some point in the past.
So, is it possible to know which channel the sample was returned from the
I2S.read() function or does this mean that the library needs to be modified?
I am more interested in using the samd library as other libraries such as AudioLibrary is limited to 16-bit - I need 32-bit resolution.