Utilities.Encoder.Wav
Simple library for WAV encoding support for Unity (UPM)
Unity Project
Download the source from GitHub
README
com.utilities.encoder.wav
Simple library for WAV encoding support in the Unity Game Engine.
Installing
Requires Unity 2021.3 LTS or higher.
The recommended installation method is though the unity package manager and OpenUPM.
Via Unity Package Manager and OpenUPM
Terminal
openupm add com.utilities.encoder.wav
Manual
- Open your Unity project settings
- Select the
Package Manager
- Add the OpenUPM package registry:
- Name:
OpenUPM - URL:
https://package.openupm.com - Scope(s):
com.utilities
- Name:
- Open the Unity Package Manager window
- Change the Registry from Unity to
My Registries - Add the
Utilities.Encoder.Wavpackage
Via Unity Package Manager and Git url
[!WARNING] This repo has dependencies on other repositories! You are responsible for adding these on your own.
- Open your Unity Package Manager
- Add package from git url:
https://github.com/RageAgainstThePixel/com.utilities.encoder.wav.git#upm
Documentation
Table of Contents
Recording Behaviour
Simply add the WavRecorderBehaviour to any GameObject to enable recording.
This will stream the recording directly to disk as it is recorded.
Audio Clip Extensions
Provides extensions to encode AudioClips to WAV encoded bytes.
Supports 8, 16, 24, and 32 bit sample sizes.
Encode WAV
Encodes an AudioClip to a WAV formatted byte[] or NativeArray<byte>.
[!WARNING] The resulting
NativeArray<byte>must be disposed of manually to avoid memory leaks, you can adjust the allocator type by passing in an optional parameter.
byte[] bytes = audioClip.EncodeToWav();
using NativeArray<byte> bytes = audioClip.EncodeToWavNative();
byte[] bytes = await audioClip.EncodeToWavAsync();
using NativeArray<byte> bytes = await audioClip.EncodeToWavNativeAsync();
Related Packages
Comments
No comments yet. Be the first!
Sign in to join the conversation
Sign In