Megool
Megool

Reputation: 999

I2S Data Structure (Inter-IC Sound)

There are tons of electrical descriptions of I2S; however, I cannot find information about how the data is formatted/structured. What I mean by format is, what does a value on the serial data line mean? Do these values have information on volume, pitch, or something else?

As an application example, I have a .wav audio file. I unpacked the file and obtained a stream of data samples. How should this sample data be transmitted on I2S so that a receiver can play the audio? 0x 0011 2233 4455 6677 8899 AABB CCDD EEFF 0011 2233 4455 ... and so on. Should these values be formatted in some way that is meaningful to the receiver? Maybe something like 0x0011____, 0x2233____, where blank means other miscellaneous information?

Let's assume for the case of I2S Standard, 24 bits per sample. Any information would be helpful. Thanks.

Upvotes: 0

Views: 398

Answers (1)

Welgriv
Welgriv

Reputation: 823

Wikipedia I²S say you'll have 3 lines, one for the clock (sample rate * bits per channel * number of channel), one for the channel selection (0 left, 1 write) and one for the data, msb first. There also some diagram. What do you need more ?

The data structure you may use in your software can be whatever you want since you correctly program the I²S IP and send the relevant data to it. You may use some array to store left channel and right channel, correctly typed regarding bits/sample.

The value of a sample is indeed the amplitude of the sampled/generated signal.

Upvotes: 0

Related Questions