Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AUDIO] Add a function to make an alias of a sound and share it's sample data #3219

Merged
merged 3 commits into from
Aug 4, 2023

Conversation

JeffM2501
Copy link
Contributor

@JeffM2501 JeffM2501 commented Aug 2, 2023

This PR adds a function that makes an alias from an existing sound. The new sound has a pointer to the sound buffer used by the donor sound and does not own the sample buffer memory.

Since PlaySoundMulti was removed, this feature makes it easy to make shallow copies of sounds that can be played multiple times with out the need to load multiple copies of the sample data. Since each sound is still it's own audio buffer, the sound instances are controllable with the existing sound API.

@JeffM2501 JeffM2501 changed the title [AUDIO] Add a function to clone a sound and share data with another sound. [AUDIO] Add a function to make an alias of a sound and share data with another sound. Aug 2, 2023
@JeffM2501 JeffM2501 changed the title [AUDIO] Add a function to make an alias of a sound and share data with another sound. [AUDIO] Add a function to make an alias of a sound and share it's sample data Aug 2, 2023
src/raudio.c Outdated Show resolved Hide resolved
@raysan5 raysan5 merged commit 601cadb into raysan5:master Aug 4, 2023
12 checks passed
@raysan5
Copy link
Owner

raysan5 commented Aug 4, 2023

@JeffM2501 thanks for addition and the review! 👍🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants