This question already has an answer here:
Is there a way that I can have something which appears as a file, but when being read some code executes which fills the content of the file "on the fly"?
Like FIFO/ named pipe, but without the need to start the writing process by hand.
Or like CGI on webservers, but on the local file system.
To guard myself against "why I want this"-doubts:
I want this to be able to have an audiofile whose content is generated on access, and then delivered to the audio player. And it should not be streaming, since when accessed by the audio player the length of the audio should be known.