Pjrc mentions that the teensy 4.0 has I2S compatibility as well as the processor is a cortex which should be compatible. How can I get the I2S libraries loaded on to my teensy?
I2S support on Teensy is part of the Teensy Audio Library. If you've installed Teensyduino and you have Teensy selected in Tools > Boards, you can find all its examples in File > Examples > Audio.
This 31 page tutorial covers all the essential features, including I2S which is used in every part.
https://www.pjrc.com/store/audio_tutorial_kit.html
You can also find a full 45 minute walkthrough video of the entire tutorial. Of course it's best to do the tutorial yourself, but if you get stuck or you just have limited time and prefer to watch Alysia and me do it, the video might help.
One minor caveat is the tutorial was written 4 years ago with Teensy 3.2. All of it should work with Teensy 4.0, as long as you have the Rev D audio shield which works with 4.0.
For using something other that the audio shield, you will need to adapt the examples somewhat. For most I2S chips, you'll just delete the stuff which controls the STGL5000 chip and add whatever is needed to get your chip to start working (if it doesn't just turn on automatically). One thing to consider is it's all designed for Teensy to generate the clock signals (BCLK, LRCLK, MCLK), so make sure your I2S chip takes those as inputs.