Skip to content

Exposed some audio related functions and added audio example#29

Open
Abev08 wants to merge 1 commit intoJupiterRider:mainfrom
Abev08:audio
Open

Exposed some audio related functions and added audio example#29
Abev08 wants to merge 1 commit intoJupiterRider:mainfrom
Abev08:audio

Conversation

@Abev08
Copy link
Contributor

@Abev08 Abev08 commented Dec 5, 2025

Exposed LoadWAV function.
In LoadWAV and LoadWAVIO:

  • changed audioBuf argument from **uint8 to *[]uint8 to be clearer and removed the necessity for user to use unsafe package to get the audio data slice,
  • added copy of the data allocated by the internal function and freed the original data ensuring that the data is freed when not needed,
  • made audioBuf and audioLen arguments optional:
    • if audioBuf is provided but the audioLen is not, the audio data is copied into audioBuf and the length of the audio data is length of the audioBuf slice,
    • if audioBuf is not provided but the audioLen is, the function returns length in bytes of the audio data (less useful option),
    • if both are not provided, the caller gets just the format of the audio data (not really useful).

Exposed GetAudioStreamGain and SetAudioStreamGain.
Exposed GetAudioStreamFormat and SetAudioStreamFormat.
Exposed GetAudioStreamDevice.
Added example that uses most of these functions.

@JupiterRider
Copy link
Owner

@Abev08 Thank you very much. Can you just please add the License of the wav File or at least tell me where you got it from?

@Abev08
Copy link
Contributor Author

Abev08 commented Dec 12, 2025

I have had this file for a very long time, I don't remember where I got it from :/
Sorry, I didn't think about the license of the sound sample I used.
Maybe it would be better to use another sample instead of this one?

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