Glossary: Diegetic / nondiegetic sound
Any sound presented as originating from a source within the world of the story (diegetic sound); any sound presented as originating from outside the space of the world of the story (nondiegetic sound).
From Blazing Saddles
Frame 1: In this parody of Westerns, shots of the new sheriff are introduced with big band music playing on the soundtrack. Since he is in the desert, and since big band music did not exist during the time the film is set, viewers would likely assume the music to be nondiegetic (outside the world of the story)Frame 2: But the joke is revealed as the sheriff rides past Count Basie and his orchestra performing the music, which turns out to to be diegetic (within the world of the story) after all