Unity Asset – AudioStream [PCM audio in Unity] v1.5

Author Alex
2020-10-7
694
0
Unity Asset – AudioStream [PCM audio in Unity] v1.5

Unity Asset – AudioStream [PCM audio in Unity] v1.5

AudioStream provides proper PCM audio streaming - both inputs and outputs oriented - support for Unity

Please download demo builds from the following links; the builds contain testing scenes for all included components.
Most of the scenes allows custom parameters such as filepath/urls to be set in order to test with your audio assets.

AudioStream can stream and play from:
* internet radios M3U/8 and PLS playlists, with support for tags (+)
* audio files hosted on the internet/cloud such as podcasts
* local audio files on a regular filesystem (according to platform)
* non realtime streams from network / filesystem with caching for later usage
* memory locations containing encoded audio
* any connected input audio device (Microphone, Line-In inputs) including multichannel ones
* non default devices on iOS, such as AirPods
* any input directly into spatialized Resonance AudioSource
In addition it can
- stream/push any of the above into connected Icecast mountpoint
- stream between two LAN instances (currently) Opus encoded audio up to two channels
- play/redirect common Unity AudioSource to other than default system output, targeting specific channel/s/speakers
- play FMOD sources on specified output and its channels/speakers using customized mix matrix
- redirect Unity MixerGroup to other than default system output with reasonable latency (++)
- has network proxy support via UnityWebRequest

For streaming and access to audio devices the low level API of FMOD Studio is used directly where appropriate (please note that no authoring FMOD Studio functionality is used).
- for list of supported audio formats please see formats and platforms FMOD recognizes (e.g. Wikipedia or FMOD Documentation; -
for example on iOS and Android m4a/AAC is supported).
It aims at zero GC allocation at runtime and is suitable for long running automatically recoverable streaming.

For network retrieval is used Unity provided UnityWebRequest - that means all sensible connection scenarios such as secure connections, redirects, custom POST data,... supported by it are available.

Note: being streaming oriented it does not provide typical offline audio processing such as advanced audio clip offline signal manipulation - these are reserved for Unity AudioClip where appropriate.
AudioStream playback component can play from/a precise position and can seek within the file if DISK cache type is used, and the file being played has finite (reasonable) size.

Please be also aware that somehow advanced knowledge of Unity audio is required and is not aimed at novice users in general.

Unity and other assets compatibility:
- compatible with all other audio packages when using AudioSource enabled, and networked components
- corresponding AudioSource can be used as usual including Unity spatialization, effecting and mixer routing - this means it can be used as AudioSource for e.g. Resonance/Oculus/Steam spatialization plugins, or any Unity Mixer in general (+++)
- fully IL2CPP compatible including standalones (Unity 2018.1 and up)
- sources are still compatible with .NET 3.5 profile
- has no PM dependencies on other optional Unity packages such as UGUI and TextMeshPro

Following is a list of included components:
AudioStream - can stream supported formats from networked or local filesystem sources and play it via Unity AudioSource
AudioStreamMinimal - same as above, but plays the audio saparately via FMOD, not going through Unity audio.
AudioStreamDownload - can download at faster than realtime playback speeds, caches decoded PCM data which can be retrieved and played back later as an AudioClip without touching the network
AudioStreamMemory - decodes audio data stored at IntPtr memory location and plays them as an AudioClip, can use cache with user identifier to retrieve immediately later
IcecastSource - pushes playing Unity AudioSource content encoded as uncompressed PCM, OGGOPUS, or OGGVORBIS into opened Icecast mountpoint

AudioSourceOutputDevice - redirects playing Unity AudioSource to specified/non default system output
- can perform multichannel separation of output, demo scene shows how to play a MONO AudioClip on selected channel of multichannel output device
AudioStreamOutputDevice native mixer plugin - similarly redirect AudioMixerGroup to specified/non default system output

AudioStreamInput - streams any connected input device into an AudioSource including multichannel microphones
- can open and stream from [loopback] devices meaning you can e.g. capture currently being played overall audio on system output on standalones
AudioStreamInput2D - same as above, except is optimized for latency and doesn't go through Unity spatialization
AudioStreamInput_iOS - can stream from all connected devices on iOS into an Unity AudioSource, including e.g. AirPods

ResonanceSource - positional streamed audio using FMOD's provided Google Resonance native plugin
ResonanceSoundfield - can play a- and b- format ambisonics files using FMOD's provided Google Resonance native plugin
ResonanceInput - can stream any audio input similar to AudioStreamInput components to 3D positioned AudioSource using FMOD's provided Google Resonance native plugin

AudioStreamNetMQSource - acts as network source for client component providing Opus encoded (max. 2-channel) stream over NetMQ transport
AudioStreamNetMQClient - LAN client for the above

GOAudioSaveToFile - saves audio of any AudioSource into a PCM16 WAV file

Included README contains comprehensive install and usage guides such as building and recording on iOS, basic support for basic iOS/Android background audio modes, considerations regarding Unity latency modes and DSP buffer settings, setting up Icecast source and mountpoint and each relevant setting is fully documented in the Editor via e.g. member fields tooltips.

Runs almost on all platforms Unity currently has audio support for (++++), at the time being tested on Windows, OS X and mobiles - iOS and Android - except WebGL currently, unfortunately.

There is a separate test/demo scene for each component/functionality

All source code is included.
Source code is Unity API upgrader friendly (i.e. should not trigger any automatic source upgrades) and has no warnings once everything is set up.

* Package includes no Editor custom menu entries, icons or configurations, no either opt-out or opt-in telemetry, no review popups; documentation is in plaintext.
Custom Inspectors for components are provided for convenience where appropriate
Asset Details:
  • Current Version: 1.5
  • More Info: https://assetstore.unity.com/packages/tools/audio/audiostream-pcm-audio-in-unity-65411

Download links:
Comments
Add comment
Add comment:
Your name:
Your E-Mail:
  • bowtiesmilelaughingblushsmileyrelaxedsmirk
    heart_eyeskissing_heartkissing_closed_eyesflushedrelievedsatisfiedgrin
    winkstuck_out_tongue_winking_eyestuck_out_tongue_closed_eyesgrinningkissingstuck_out_tonguesleeping
    worriedfrowninganguishedopen_mouthgrimacingconfusedhushed
    expressionlessunamusedsweat_smilesweatdisappointed_relievedwearypensive
    disappointedconfoundedfearfulcold_sweatperseverecrysob
    joyastonishedscreamtired_faceangryragetriumph
    sleepyyummasksunglassesdizzy_faceimpsmiling_imp
    neutral_faceno_mouthinnocent
I am not robot: *
Archive
«    November 2024    »
MonTueWedThuFriSatSun
 123
45678910
11121314151617
18192021222324
252627282930 
October 2023 (1)
May 2023 (1)
February 2023 (518)
January 2023 (532)
December 2022 (515)
November 2022 (504)
Vote
Upgrade to Premium