Skip to content

Commit

Permalink
Add stream.realtimeSafe() as a way to know if the stream use dangerou…
Browse files Browse the repository at this point in the history
…s non-realtime operations.
  • Loading branch information
Guillaume Piolat committed Aug 15, 2021
1 parent 8f10436 commit ceec776
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/audioformats/stream.d
Expand Up @@ -218,6 +218,12 @@ public: // This is also part of the public API
startEncoding(format, sampleRate, numChannels);
}

/// Returns: `true` if using operations that are accetpable in an audio thread (eg: no file I/O).
bool realtimeSafe() @nogc
{
return fileContext is null;
}

~this() @nogc
{
cleanUp();
Expand Down

0 comments on commit ceec776

Please sign in to comment.