Neos now has completely redesigned handling of audio assets and buffers with variety of benefits, giving it full control over audio data. Not only is the new system more performant (e.g. removing lag when you play too many compressed audio effects at once and removing a lot of redundant works), but also supports playing audio at varying speed (including reverse) changing its pitch! This is fully controllable with LogiX as well. This enables variety of applications and sound effects that weren't previously possible.
You can also now do basic audio editing/processing in Neos - normalizing volume, trimming, adding fade in/out and converting between formats, with a lot more to come in the future. Neos can now also not only decode audio, but supports encoding to WAV, OGG Vorbis and FLAC as well, which now powers a new Microphone tooltip, which lets you make audio clips directly in-game!
There is a lot more to come in the future based on this redesigned system as well - procedural audio clips, more editing options, asset variant system and so on. The handling of realtime audio streams (e.g. voice) was also improved, increasing performance, adding support for stereo (currently unexposed) and reducing some audio glitches and stutters (might need some extra fine-tuning as we go).
There's also bunch of other tweaks, additions and bugfixes as usual. I really wanted to rewrite the audio system to enable this for a long while, I hope you'll have lots of fun with it and I can't wait to see what kind of audio shenanigans you'll create!
New Features:
- AudioClipPlayer now supports changing playback speed (resulting in change of pitch) as well as reverse playback (previously requested by @ProbablePrime, @H3BO3, @Kal, @orange and many others (sorry I forgot ;_;))- DrivePlaybackNode now has "MaximumPositionError" and "Speed" inputs
-- "MaximumPositionError" allows setting a tolerance in seconds, which will prevent the node from changing the current playback position if it's close enough to the new position (this can be used to avoid some skipping, while still ensuring the playback is mostly synced to an input value)
-- Speed allows smoothly modulating the playback speed. For audio sources it's recommended to use MaximumPositionError to avoid skipping. Set MaximumPositionError to Infinity if you don't care about the playback position being synced across users.
- PlayOneShot node now had "Speed" input, which allows setting the speed that the clip will play at
- Added "MicrophoneTip" tooltip, which allows conveniently recording user voice in-game
-- Supports recording into WAV, OGG Vorbis and FLAC (Vorbis quality can be changed through inspector)
-- Has two modes to record - hold trigger to record, or press trigger to start/stop recording (you can drop the tool and it'll keep recording with the latter)
-- You can also record either raw audio coming from microphone or processed (filtered and noisegated)
- AudioInput system and OpusStream now support recording/transmitting stereo audio (voice still uses Mono by default)
- Added audio processing actions to the StaticAudioClip in the inspector (similar to textures and meshes)
-- Normalize Volume
-- Trim (Start/End/Both) Silence - uses configurable amplitude threshold
-- Trim Start/End - uses duration in seconds to trim the audio clip
-- Add Fade In / Fade Out - uses duration in seconds to add volume transition
-- Convert to WAV / OGG Vorbis / FLAC
- Inspector now shows basic loaded audio clip information (sample rate, channels, duration, format)
- Added AudioClipAssetMetadata which provides metadata for an audio clip (SampleRate, Channels, Sample Count, Duration, Codec Info)
- Inspector now lets you adjust the playback speed directly in the inspector window (this works for any playback, but can be used for the new audio as well)
- Added "World Hide From Listing" node that indicates if the world is currently hidden from listing (requested by @Raith)
- Added silence <username> and unsilence <username> commands to the headless
- Added IntToEnum<E> node (requested by @Coffee | Programmer)
Optimizations:
- Redesigned & rewrote the audio clip asset system for a significantly more efficient design, based around new AudioX class to handle audio data-- The new system uses Span<T> to reinterpret buffers (Mono/Stereo samples), allowing use of vectorization for faster processing and simplified code
-- The system also eliminates many redundant reads and conversions of audio data, often ensuring that data is read/converted in one go by the target reader (it allows resampling reads directly from the buffer)
-- It supports both fully decoding data in-memory or streaming from encoded version (WAV, OGG Vorbis, FLAC...)
-- For streaming decoding, new AudioBufferPool system is used. This uses a shared pool of memory to prevent redundant decoding of audio data and causing performace issues (e.g. when using OGG for sound effects played multiple times)
-- The system supports encoding audio data as well, currently into WAV, OGG Vorbis and FLAC
-- Resampling audio input/output will no longer produce audio chunk boundary artifacts, due to cutting off partial samples
- StaticAudioClip now has "LoadMode" and "SampleRateMode" properties
-- LoadMode determines how are the audio data decoded, regardless of format:
--- Automatic (default) - will fully decode in-memory any clips shorter than 10 seconds, otherwise streamed from file
--- StreamFromFile - decodes the audio data on the fly from the file in the disk
--- StreamFromMemory - loads the file fully into memory and decodes on the fly
--- FullyDecode - completely decodes the audio data into memory (not recommended for long clips, will use lots of RAM, but strongly recommended for short audio clips)
-- SampleRateMode
--- Original - leaves the sample rate as-is
--- Conform - will resample the clip to system sample rate to help avoid having to resample it on the fly (currently only done when FullyDecode is active)
- Redesigned circular audio buffers used for user audio data (filling from microphone/network stream and reading for playback/encoding) based on the new system, reducing complexity and improving speed
- Optimized underlying CSCore library to avoid redundant audio format conversions
Tweaks:
- Improved AudioStream handling of playback to help reduce voice stutters due to latency jitter- Fixed audio artifacts with AudioStream due the last chunk of samples getting cut off and used when the new chunk arrives
- Contextual tutorial label for opening tool menu is now localizable
- Removed outdated "Double press to dequip" contextual tutorial label for tooltips (reported by @Hayden (PolyLogiX Studio))
- Default value for quaternion and matrix dynamic variables is now identity (based on report by @Earthmark)
-- This should affect every case where the variable or space is missing for all dynamic variable components, including DynamicVariableInput and ReadDynamicVariable nodes
- Renamed StaticAudioClipProvider to StaticAudioClip
- Merged Spanish locale additions by @Ruzert
- Merged Japanese, Esperanto and Chinese locale additions by @Melnus
- Merged Norwegian locale additions by @Revi
- Merged Polish locale additions by @art0007i
- Merged Dutch locale additions by @jeana and @Alex the insufferable avali 🐦
- Merged Finnish locale additions by @Napo
- Added new strings to the Czech locale
- Added initial Swedish translation by @Coffee | Programmer, @Swingly and @Rulle (currently mostly incomplete)
- AudioStreams will no longer cut off very quiet sounds, as this is now handled by the input noise gate
- Upgraded to Unity 2019.4.13f1 (from 2019.4.12f1)
Bugfixes:
- Fixed beginning of an audio clip getting cut of on repeated playbacks, resulting in very short audio clips not being played on repeated playbacks (reported by many people in the past, I don't remember any specific ones though sorry ;_;)- Fixed playback position resulting in NaN when the clip length is zero
- Fixed wrong audio being played from video players when the video asset isn't loaded due to buffer reuse
- Fixed VisemeAnalyzer producing incorrect analysis on stereo audio sources
- Fixed ToTimeString adding extra 0 between seconds and milliseconds (reported by @CuriousVR)
- Fixed incorrect 8 bps WAV encoding in CSCore library
- Fixed SyncPlayback resetting position to 0 when the speed is set to 0 (discovered by @Dante)



Changed files in this update