In general, which language or languages were the sutras compiled and was this the same language tha Shakyamuni spoke?
Shakyamuni Buddha spoke in a language known as Magadhi Prakrit. According to this article https://www.quora.com/What-language-did-Gautama-Buddha-speak-according-to-Indian-mythology-and-why-is-it-significant there are no written records in his language. Instead, they were later written down in Pali, Sinhalese, and Sanskrit.
Magadhi is Pali language in the spoken form at the time of the Buddha. Magadhi was a dialect spoken in the Maghadan area in the eastern part of North India and was thought likely to be a composite with features assembled from different geographical areas. Theravada Buddhists consider that Magadhi was probably the language preferred and used by the Buddha. It was this language that came to be developed and formalised as a written language, which we now call “Pali”.
Pali is a written language, but it has no special script. It should be noted that the Magadhi/Pali we have now may not be the full and accurate spoken language of those days and in fact, may not have been actually used in this present form.
Pali, (“Pali” means “text”), has a vocabulary that has special significance for the study of Buddhism, because its words have been well defined for the needs of the Buddha’s teachings, which no other language could successfully define.
Pali is the language of the Theravada Buddhist religion’s record of teachings, the “The Tripitaka” the Vinaya Pitaka (the collection of rules for Monks), the Sutta Pitaka (main body of collected teachings) and the Abidhamma Pitaka (a later addition to original teachings).