diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/decoders/raw.cpp | 6 | ||||
-rw-r--r-- | sound/decoders/raw.h | 16 |
2 files changed, 21 insertions, 1 deletions
diff --git a/sound/decoders/raw.cpp b/sound/decoders/raw.cpp index f726d91cc5..18abfdcb35 100644 --- a/sound/decoders/raw.cpp +++ b/sound/decoders/raw.cpp @@ -426,6 +426,12 @@ SeekableAudioStream *makeRawStream(Common::SeekableReadStream *stream, return makeRawStream(stream, blocks, rate, flags, disposeAfterUse); } +SeekableAudioStream *makeRawStream(const byte *buffer, uint32 size, + int rate, byte flags, + DisposeAfterUse::Flag disposeAfterUse) { + return makeRawStream(new Common::MemoryReadStream(buffer, size, disposeAfterUse), rate, flags, DisposeAfterUse::YES); +} + SeekableAudioStream *makeRawDiskStream_OLD(Common::SeekableReadStream *stream, RawDiskStreamAudioBlock *block, int numBlocks, int rate, byte flags, DisposeAfterUse::Flag disposeStream) { assert(numBlocks > 0); diff --git a/sound/decoders/raw.h b/sound/decoders/raw.h index c3be9f16a1..e6fe0d6abf 100644 --- a/sound/decoders/raw.h +++ b/sound/decoders/raw.h @@ -118,10 +118,24 @@ struct RawDiskStreamAudioBlock { typedef Common::List<RawDiskStreamAudioBlock> RawStreamBlockList; /** + * Creates an audio stream, which plays from the given buffer. + * + * @param buffer Buffer to play from. + * @param size Size of the buffer in bytes. + * @param rate Rate of the sound data. + * @param flags Audio flags combination. + * @see RawFlags + * @param disposeAfterUse Whether to free the buffer after use (with free!). + * @return The new SeekableAudioStream (or 0 on failure). + */ +SeekableAudioStream *makeRawStream(const byte *buffer, uint32 size, + int rate, byte flags, + DisposeAfterUse::Flag disposeAfterUse = DisposeAfterUse::YES); + +/** * Creates an audio stream, which plays from the given stream. * * @param stream Stream object to play from. - * @param size Size of the buffer. * @param rate Rate of the sound data. * @param flags Audio flags combination. * @see RawFlags |