diff options
author | Jörg Müller <nexyon@gmail.com> | 2021-08-30 23:36:02 +0300 |
---|---|---|
committer | Jörg Müller <nexyon@gmail.com> | 2021-09-18 22:45:33 +0300 |
commit | bdbc7e12a02e15ad7265dfc1ac21fb6d0016308f (patch) | |
tree | e9b967deb25f77eef348786f5cd22524eef0ec20 /extern/audaspace/bindings/C/AUD_Sound.h | |
parent | 970c928f27106b26ec7cf6afa2316c60384ab4f1 (diff) |
Audaspace: added audio file streams functionality.
On the blender side this commit fixes importing video files with audio
and video streams that do not share the same start time and duration.
Differential Revision: https://developer.blender.org/D12353
Diffstat (limited to 'extern/audaspace/bindings/C/AUD_Sound.h')
-rw-r--r-- | extern/audaspace/bindings/C/AUD_Sound.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/extern/audaspace/bindings/C/AUD_Sound.h b/extern/audaspace/bindings/C/AUD_Sound.h index 53172616781..fc73a31e15c 100644 --- a/extern/audaspace/bindings/C/AUD_Sound.h +++ b/extern/audaspace/bindings/C/AUD_Sound.h @@ -36,7 +36,15 @@ extern AUD_API AUD_Specs AUD_Sound_getSpecs(AUD_Sound* sound); * \return The length of the sound in samples. * \note This function creates a reader from the sound and deletes it again. */ -extern AUD_API int AUD_getLength(AUD_Sound* sound); +extern AUD_API int AUD_Sound_getLength(AUD_Sound* sound); + +/** + * Retrieves the stream infos of a sound file. + * \param sound The sound to retrieve from which must be a file sound. + * \param infos A pointer to a AUD_StreamInfo array that will be allocated and must afterwards be freed by the caller. + * \return The number of items in the infos array. + */ +extern AUD_API int AUD_Sound_getFileStreams(AUD_Sound* sound, AUD_StreamInfo** stream_infos); /** * Reads a sound's samples into memory. @@ -90,6 +98,15 @@ extern AUD_API AUD_Sound* AUD_Sound_buffer(sample_t* data, int length, AUD_Specs extern AUD_API AUD_Sound* AUD_Sound_bufferFile(unsigned char* buffer, int size); /** + * Loads a sound file from a memory buffer. + * \param buffer The buffer which contains the sound file. + * \param size The size of the buffer. + * \param stream The index of the audio stream within the file if it contains multiple audio streams. + * \return A handle of the sound file. + */ +extern AUD_API AUD_Sound* AUD_Sound_bufferFileStream(unsigned char* buffer, int size, int stream); + +/** * Caches a sound into a memory buffer. * \param sound The sound to cache. * \return A handle of the cached sound. @@ -104,6 +121,14 @@ extern AUD_API AUD_Sound* AUD_Sound_cache(AUD_Sound* sound); extern AUD_API AUD_Sound* AUD_Sound_file(const char* filename); /** + * Loads a sound file. + * \param filename The filename of the sound file. + * \param stream The index of the audio stream within the file if it contains multiple audio streams. + * \return A handle of the sound file. + */ +extern AUD_API AUD_Sound* AUD_Sound_fileStream(const char* filename, int stream); + +/** * Creates a sawtooth sound. * \param frequency The frequency of the generated sawtooth sound. * \param rate The sample rate of the sawtooth sound. |