Hi, can tracktion engine stream audio from a memory source? thx

Can I ask the use case?
There might be different approaches depending.

1 Like

Hi. So rather than loading the audio data for a clip from a file, it’ll be sourced from a shared memory block that will be populated by another process. So I’ll need to attach a clip to a track and play it, but have it callback propably into a function that can give it a chunk of data as I fetch it from shared memory. This will be done for multiple tracks. Cheers

Hi @dave96, any thoughts on this? Thx

Is the shared memory block fully populated with the audio data or is it dynamically filled as it is being played back?

All the standard playback code expects the files to be on disk for lots of complex reasons including knowing when to reload them and dirty thumbnails etc. If it’s just a chunk of audio data in shared memory, could you not just write it to a file?

If it’s being dynamically populated, I’m not sure that’s going to work as the length of the file will keep changing right? Or can you leave the length part of the header off (or make it a high number) and fill in zeros for non-populated data? But tbh, if this is the case, I would probably handle playback yourself by wrapping the logic in a te::Plugin subclass, that way you won’t have to bend it in to the existing file playback system.

Does that make sense?

1 Like

Hi, it’ll be dynamically populated, so won’t all be available.

The suggestion of wrapping the logic in a plugin does make sense - thanks!