Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

AudioStream - an audio streaming solution for all and everywhere

Discussion in 'Assets and Asset Store' started by r618, Jun 19, 2016.

  1. felix_izarra

    felix_izarra

    Joined:
    Dec 7, 2018
    Posts:
    8
    I compiled it and ran it but I don't know how to check. I am able to listen some audio if I hit "Play sample" & "Request Speaker Override" but if I set "Request default output" it doesn't make any sound on my headphones

    WhatsApp Image 2019-02-25 at 8.56.57 AM.jpeg
     
  2. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    just to make sure - that screenshot is from device - correct ? It won't run in simulator properly
    (and makes me wonder why it didn't detect notch -)

    You want to check your inputs which is all I wanted to know in essence
    - you have 'iPhone Microphone' and 'Headset Microphone' - I assume you don't see 'Headset Microphone' in AudioStream demo app - is that correct ?

    Once you select your input you press 'Start recording' - you record from the selected input -, press 'Stop recording' when you have enough - the recorder audio is then immediately played on loop on current default output ( as displayed under 'Categotry outputs' )

    [ You can override output to speaker in situations when it makes sense - it's not always possible ]

    The testing sample is just for ... testing the sound output without any recording (it uses its own separate player)

    So in your case the goal is to record audible sound from 'Headset Microphone' - let me know if you are able to
    - the hinted sound quality is nothing extraordinary - I think I requested 24000 samplerate, but made sure to request 2 channels -
    I suppose channel count would be harder to check - I would have to add channel metering
     
  3. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    just for the record @felix_izarra - please paste here also screenshot of AudioStreamDemo's AudioStreamInput2D scene
    (make sure just 'Prepare iOS for recording' is selected in Unity Player Settings)

    Thanks !!
     
  4. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    to clarify 'Options:' you very likely don't need any one of them checked btw:
    .allowBluetooth* doesn't apply if you don't have BT device ( although I'm *not entirely* sure tbh ), and .defaultToSpeaker does essentially the same as Speaker override button - only at different time (tm)

    [note for interested reader: if the overall design does not make complete sense at first sight don't worry - that's how Apple laid things out, the app is just basically following them 1 : 1]
     
  5. felix_izarra

    felix_izarra

    Joined:
    Dec 7, 2018
    Posts:
    8
  6. felix_izarra

    felix_izarra

    Joined:
    Dec 7, 2018
    Posts:
    8
    Is working good now!

    Is recording stereo and showing the audio playback from where it should be coming from. I just had to record the audio without changing all the settings.

    So, what does it means now?

    WhatsApp Image 2019-02-25 at 11.43.48 AM.jpeg
     
  7. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    thank you @felix_izarra and good to hear it's working
    just one little piece of puzzle I need yet now: can you please run AudioStreamDemo ( the package as comes from the asset store ) on your iOS device, and post screenshot of AudioStreamInput2D scene once it opens ?
    [ In Unity it's necessary to select just 'Prepare iOS for recording' in Player Settings ]

    I assume there's just one Core Audio device with channels: 1 - but I'd like to have it confirmed - thank you! :)

    --------------
    as for what now: well it's "just"a matter of convincing fmod/AudioStream/Unity to work with all inputs similarly as the app does; I'm not entirely sure it won't be overly complicated, or even possible still
    but your testing helped a great deal, at least it's clearer what to test exactly - so thanks again !

    Overall - it won't work in Unity for some time still - sorry about that - that's about it for now
    I'll be sure to post an update once I have something new
    Thanks !
     
  8. felix_izarra

    felix_izarra

    Joined:
    Dec 7, 2018
    Posts:
    8
    Here I'm giving you an screenshot of AudioStreamDemo running on my phone and AudioStreamInput2DDemo too, this screenshots were made building to my phone, disconnecting it from my mac, connecting my wired headset and running the app.

    WhatsApp Image 2019-02-25 at 2.36.50 PM.jpeg WhatsApp Image 2019-02-25 at 2.36.50 PM (1).jpeg
     
    r618 likes this.
  9. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    Thank you @felix_izarra !
     
  10. nicoschtein_rga

    nicoschtein_rga

    Joined:
    Sep 18, 2017
    Posts:
    2
    Hi ! I'm interested in the following use case, if this is supported then i'll get the plugin right away.
    I need to play some audio files on the iOS device speaker/earpiece and some on bluetooth/Airplay2 devices, at the same time.
    Can this be done using this plugin?
    Thanks!
     
  11. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    no can't do atm, unfortunately,
    since fmod currently does not support this either for input or output (see conversation above), I'd need to develop completely new solution for iOS
    given the scope of the thing a new separate plugin would probably make sense too, will have to think about this

    (right now you can modify the audio session in Xcode part to include BT devices (this is not part of the plugin), but the output will always be either on one (system speaker) or on another, based on connection state of the device)
     
  12. nicoschtein_rga

    nicoschtein_rga

    Joined:
    Sep 18, 2017
    Posts:
    2
    Thanks for clarifying !
     
  13. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    Just heads up for people reading the forums:

    FMOD released 2.00.00 few days ago just before GDC

    - the c# wrapper seems to be working, they just renamed two PCM callbacks delegates for some reason - it's enough to change to new names which we.g. intellisense can help with
    - and they removed gvraudio libraries leaving only Resonance - so GVR scenes won't work
    - otherwise it works with AudioStream

    , this FMOD release has also label 'Early Access' meaning it should be safe to use with new projects - but anyway if you run into any any troubles just use latest 1.10 version which can still be downloaded

    I will bump AudioStream to version 2.0 once all intended changes are in
    - it will then be backwards incompatible with 1.10 versions
     
  14. Laminariya

    Laminariya

    Joined:
    Mar 15, 2017
    Posts:
    1
    Good afternoon, !
    Is there a possibility to continue playing audio in the situation when the connection has been broken and then restored?
     
  15. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    Hi @Laminariya

    it should disconnect gracefully when network loss occurs or the connection is degraded to a point when it starts loosing too many audio frames
    You have to restart manually though - I recommend handling OnPlaybackStopped event and schedule new start on the main game loop, not from the handler directly (although it should theoretically work I don't recommend doing so)

    There's nothing automatically done right now, although I think it makes sense to add this to the demo

    Let me know if this helps
     
  16. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    After July 1st 2019 I'll be submitting updates with 2017 LTS version (it's an asset store requirement after that date)

    If anyone has concerns and/or need to be working with pre-2017 versions of Unity after, please let me know!
     
  17. JonDadley

    JonDadley

    Joined:
    Sep 2, 2013
    Posts:
    139
    What's the best method for making a single AudioStream component output to multiple audiosources simultaneously? I have an object with both an AudioStream component and an audiosource on it that plays correctly. However, if I try this:

    Code (CSharp):
    1.         target.clip = original.clip;
    2.         target.time = original.time;
    3.         target.Play();
    the stream starts playing on the new audiosource but stops playing on the original audiosource. Is there a better method for making it play on both simultaneously? I'm trying to play a streaming internet radio station.
     
  18. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    Hello there!

    This is more question about Unity audio routing [I will assume original AudioSource/AudioStream, and e.g. two outputs from it each being a split from the original]

    - btw you can't steal clips between AudioSources that way - although clever, I was surprised the above even works without Unity exploding (works to a degree - it leaves the clip playing on the last assigned source in 2017 I tested on)

    The following depends on whether you need separate AudioSources and spatialization, or not - depending on the answer, things might or might not get complicated:

    * if you don't need separate AudioSources you can use Send effect from a mixer group to two Receivers: set 'Output' on origin AudioSource to a mixer group which has two Sends to two other groups, e.g.:
    upload_2019-4-29_17-27-1.png
    - you can then apply any effects on each split independently
    - but note you loose spatialization on each individual split (Out1 and Out2) - unless you probably use something like Resonance which should be capable of doing it on mixer group/s

    * for AudioSources one of the ways of doing this is again using mixer, with custom effect and having each AudioSource pulling its own audio data - see https://bitbucket.org/Unity-Technologies/nativeaudioplugins and 'speakerrouting' scene.
    (you can just clone the project, open the scene and it should play without any changes)

    - this could be done with (not so complicated) user scripts too, where each interested AudioSource would e.g. pull from a single source via OnAudioFilterRead callbacks
    the former is probably much faster though, and I'm not sure how not/easy would be for all 3D settings to behave correctly in this case if spatialization is needed

    .. hope I didn't forget anything
     
    JonDadley likes this.
  19. JonDadley

    JonDadley

    Joined:
    Sep 2, 2013
    Posts:
    139
    Thanks for the informative reply, that's super useful :)
     
    r618 likes this.
  20. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    Asset will be 50% off during this year's May madness sale which will last for the next two weeks or so
     
  21. ankush20

    ankush20

    Joined:
    Oct 18, 2013
    Posts:
    2
    Hi r618

    I need to play audio files from streaming asset folder. With your plugin is it possible to play the audio by just giving the path of the audio file(streaming folder path) ?

    Because right now i am using unitywebrequest class and it freezes the application when i try to load audio.
     
  22. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    Hello @ankush20 , streaming from local filesystem is supported, yes
    You can test it in the demo application e.g. in the first - AudioStreamDemo - scene ( download links are on the store page ) - enter the file path (without the 'file://' prefix) instead of url in 'Stream' field
    Absolute path will work for supported audio files (relative path might work, but I'm not entirely sure right now)

    Both components (AudioStream and AudioStreamMinimal) behave the same

    ––
    Note: if a playlist path is entered UnityWebRequest will still be used for file path extraction

    Hope this helps!
     
  23. ankush20

    ankush20

    Joined:
    Oct 18, 2013
    Posts:
    2
    Hi

    Thanks for the clarification, I have not brought it yet but as you are saying that my requirements will be fulfilled. Now i am gonna buy it.

     
  24. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    Hey, good luck !

    Be sure to read included !!README1ST!! first about how to setup the package (you need separate download from FMOD as well).

    In case of any uncertainty don't hesitate to ask !

    ––

    Just to clarify : you don't have to buy the demo application, it's available on the store page for cases like these - to test all functionality - each component in the packages has its own testing/demo scene.
     
  25. Whitebrim

    Whitebrim

    Joined:
    Jul 11, 2017
    Posts:
    11
    upload_2019-5-22_11-36-58.png
    I did build on 2017.4.20 in IL2CPP to aab with all platforms.
     
  26. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
  27. mkg2w

    mkg2w

    Joined:
    Aug 19, 2013
    Posts:
    38
    We have a interactive story game, and would like to play audio files of the voices from a web URL.
    Does the plugin support buffering ?
    A story will have multiple characters and voices are usually in sequence, but can change depending on the options made by the player ; how can sequence of voices be controlled ?
     
  28. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    Hi,
    it's possible to download track beforehand with 'AudioStreamDownload' component - it caches decoded audio and you can set non-realtime speed for it, meaning it can download and decode track as fast as possible (or the network connection permits)

    It can play the audio afterwards from cache without e.g. touching network, if configured to do so
    So in your case you can either have many/few AudioStreamDownload components/GOs and play them as necessary, or swap url on one GO as needed for playback
    ^ but there is no builtin management e.g. for track sequencing - you'd have to do this yourself

    (technically it saves raw decoded audio data as download progresses, playback retrieves them and creates an AudioClip which is then played as usual)

    There might be problem with accessing secure (https) resources (it's mentioned on the asset page) - currently this mostly does not work, except for the simplest server configurations, unfortunately
    I'd have to find a way to make this work with UnityWebRequest which handles current state of the web much better in this regard, but it takes time (and Unity versions to support).

    That said - I recommend downloading demo application for your platform from the asset store page and test any link you intend to be using in 'AudioStreamDownloadDemo' demo scene

    Hope this helps, let me know if you have further questions!
     
    Last edited: Jun 6, 2019
  29. Simon75012

    Simon75012

    Joined:
    Sep 15, 2016
    Posts:
    72
    Hi,
    I saw your plugin can work with background mode.
    Let's say i have 50 different ambiance sounds on my server (relaxing sounds). User can mix them and play several sounds at the same time.
    Does streaming/loading 2-3 sounds at the same time is possible with your plugin?
    Does the loading/streaming works in background mode?
     
  30. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    It plays all/as many instances as you have in the scene -
    - in the first demo scene there are two (slightly different) components, but you can point them to different urls if you download the demo application

    EDIT: also in 'AudioStreamStressTestDemo' demo scene there are 10 AudioStream instances connecting/playing. - they are connecting to the same radio, but you can of course point them to different sources.

    Everything works in background mode (that's its point)
    But you'll kill the battery with it, Unity is not very suitable for this usage
    ------

    further to background mode: I'll try to include android service in ~ v 2.1 so that might help a bit if I get it to work
     
    Last edited: Jun 28, 2019
  31. OscarCybernetic

    OscarCybernetic

    Joined:
    Sep 12, 2018
    Posts:
    20
    Hello again. Your asset is working better than ever since I last spoke to you. Great job!

    I wanted to ask about the AvailableInputs() method in AudioStreamBase. I'm using it to periodically check if the user has changed their inputs but it seems like the numbers never change after the first check (if I had two devices plugged it, it'll return 2, but if I unplug one or plug in a new one, it still returns 2). Eventually, it starts returning an INVALID_PARAM exception from fmod. I was wondering if you had any insight as to what I can do about this. The error comes from the getRecordNumDrivers method
     
  32. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    Hi, thank you!

    You would need to do some work for this - as you noticed the device list is being kept intact since the time of creation of the system during its entire lifetime
    ( the error you're getting is probably because you're requesting a device id which is in the list - since it wasn't changed - but the id no longer exists as connected device so it fails at opening it )

    - you would have to listen to device changed notification, similarly as here:
    https://forum.unity.com/threads/aud...all-and-everywhere.412029/page-5#post-3398754

    , keep track of devices, update their list accordingly and act as necessary
    note that this event fires even if user just changes the default device IIRC

    I will probably think about this and might add it into component itself, allowing the user to optionally enable it, and have to do it in a efficient way -
    Will take some time since I have rather large update coming, I'll try to add it into the next one after that
     
  33. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    Just submitted 1.9 for review
    It's rather big release aimed originally to be 2.0, alongside of FMOD 2.00, but since that will arrive probably much later I decided to publish what I have so far instead. Enjoy !

    v 1.9 072019
    - checked compatibility with FMOD 1.10.14
    please note that you can use/upgrade to FMOD 2.00 which is in Early Access, but you would have to fix few compile errors due to renamed callback in C# Wrapper. Otherwise it seems to be working fine though (tm).
    - submitted with Unity 2017.4.1 as lowest officially supported version

    Updates/fixes:

    - AudioStreamInput2D : fixed multichannel input with Mono system output
    - AudioStreamInput* : added option to skip [loopback] devices - this means that device enumeration can return the same input devices set as Unity audio/Microphone class.
    - AudioStreamInput* demo scenes : fixed RMS meter for zero/not present signal, added reaction cube for each channel separately
    - AudioStream/Minimal : added new 'continuosStreaming' user flag to attempt to automatically reconnect/play again when the connection is dropped/finished
    (so components can keep trying connecting and playing ad infinitum without user intevention/code automatically)
    - AudioStreamMemory : decoupled from AudioSource, fixed performance bugs, reading of tags is optional (defaul off), decoding buffer sizes are now automatic, decoded data can be optionally cached to disk (default off)
    - AudioStreamDownload : decoupled from AudioSource, saved into application cache with '.raw' extension with stream properties at the beginning of the file
    Both of these optionally call back new 'OnAudioClipCreated' user UnityEvent with newly constructed clip so it can be used independently

    New Components:

    - AudioStreamInput2D_iOS : allows recording from any connected input on iOS device, such as AirPods; signal is routed into an AudioSource so can be used as usual in Unity
    - ResonanceInput : records from any availble input - similarly as AudioStreamInput* component - and plays back the input processed by FMOD's provided Google Resonance DSP plugin in 3D. The playback is separate from Unity for now.
    - ResonanceSoundfield : a- b- format ambisonic source - replaced GVRSoundfield
    - ResonanceSource : 3D spatialized AudioSource - replaced GVRSource
    - AudioStreamNetMQSource : audio streaming server based on NetMQ.Unity libraries
    - AudioStreamNetMQClient : audio streaming client based on NetMQ.Unity libraries
    NetMQ.Unity is based on NetMQ with fixes for .NET 3.5 runtime, works on 4.6 (Unity 2017 LTS still defaults to 3.5 runtime)

    New testing scenes:
    - AudioStreamInput2D_iOSDemo (runs properly on iOS only)
    - ResonanceInputDemo
    - AudioStreamMinimalStressTest
    - AudioStreamMemoryStressTest
    - AudioStreamDownloadStressTest
    - testing scenes in demo application are divided into groups for Features and Stress tests

    Removed:

    - all UNET transport references in components and demos, replaced with NetMQ, see above
    - all GoogleVR components and scenes were replaced by FMOD's provided Google Resonance plugin

    General:

    - fixed all UNITY_WSA threading defines
    - native plugins sources are newly included in 'AudioStream/Plugins/AudioPlugin.zip' with build instructions for 64-bit Windows and macOS
    - demo assets are now distributed with asset store package and are copied automatically into project's StreamingAssets when the package is imported/if they're not present so they can be used at runtime
     
  34. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    ^[the 1.9 update is live after a small hiccup (because of the key image of all things `o')]
     
  35. AlexFreshP

    AlexFreshP

    Joined:
    Jul 23, 2019
    Posts:
    3
    I guess playing m4a on other platform than iOs is not an option right?
     
  36. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    Android should work too, but nothing else
    - it's either still burdened by patents/licensing or support for it didn't make it into mainline FMOD yet - I'm not sure which one is it - -

    (just for curiosity probably: there is GPL implementation for it : https://www.audiocoding.com/faad2.html , so it's possible to create plugin for e.g. FMOD with it, but I'm not sure about its commercial availability either)
     
  37. Simon75012

    Simon75012

    Joined:
    Sep 15, 2016
    Posts:
    72
    Hi, is there a way to stream a loop mp3 file and make it stop after xx seconds?
    Example, i have a 10 seconds rain sound and user decide to play this sound for 5 minutes. And i need it to work in background mode (ios+android)
    Thanks.
     
  38. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    - if you want the file to loop, enable 'continuosStreaming' - it its primarily intended to always re/connect after any dropout, which the end of file is considered to be that, too
    but you will not get seamless looping, i.e. there will be a pause while the file is being started again
    - you have to stop by yourself

    - your script is running in background mode
    (note that I don't recommend using unity for background mode very much though because of battery drain)

    I just woke up hope that makes sense
     
  39. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    oh btw you can of course use AudioStreamDownload or AudioStreamMemory to get an AudioClip out of the audio file and then play it looped normally via Unity - you'll get then seamless looping
     
  40. AlexFreshP

    AlexFreshP

    Joined:
    Jul 23, 2019
    Posts:
    3
    Thanks for the answer! Also, does this plugin work on console? Making a game which stream .mp3 on Nintendo Switch, Xbox and Playstation?
     
    Last edited: Jul 29, 2019
  41. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    you'd have to request console native bits from fmod ( see your profile on fmod.com : https://fmod.com/profile#permissions )

    That said: it should work, but I think there are limitations such as having either Unity audio, or external FMOD audio running exclusively, i..e not both at the same time
    But I've never tested on a physical console so I'm not sure -

    It also has way less capable networking support compared to UnityWebRequest (I'm in the middle of upgrading this) - which asks for question: does UnityWebRequest not work for you ?
    UnityWebRequestMultimedia should allow you to get a clip from network, though I'm not sure about it being able to actually stream it (i.e. playing it while downloading) - I haven't looked at it for some time now
     
  42. AlexFreshP

    AlexFreshP

    Joined:
    Jul 23, 2019
    Posts:
    3
    Actually, we download the files locally then stream them. The problem is, streaming external .mp3 don't work on PC and Mac with Unity, so we don't know if they gonna work on console. We are waiting to receive the dev kit but meanwhile, I'm trying to find alternatives. And yes we are using UnityWebRequestMultimedia.
     
  43. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    If you have files locally already the asset should help you play them in two ways -
    AudioStreamMinimal would play it directly from disk, bypassing Unity output, and AudioStream more or less in the same way except it feeds normal unity AudioSource with decoded audio (so audio is being played by Unity in the end)
    - so it depends whether you want any further audio processing to be done in user scripts or not

    There is one issue on Xbox as I found out : https://qa.fmod.com/t/integrating-fmod2-0-to-build-for-xbox-one-one-ue-22/14622/4 : - so you can have either Unity audio, or other FMOD/AudioStream audio, but not both -
    If that is a problem I'd maybe try finding out if streaming clips/audio are possible in FMOD Studio and possibly bring over all application audio to it (and turn off audio in Unity), if yes
     
  44. Musketeer

    Musketeer

    Joined:
    Jun 7, 2015
    Posts:
    1
  45. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    Hi, I removed UNET completely already in latest release - it's using NetMQ for transport instead, which is very reliable on LANs
    I'll do some performance testing with Mirror to see if it's feasible
     
  46. graum

    graum

    Joined:
    May 27, 2013
    Posts:
    8
    Hello, I just purchased AudioStream and following the instructions. I've imported the FMOD plugin (v2.00.03) from their website. However, I am getting a compile error in Unity 2019.1.13 on Android Platform. Here is the error:


    Assets/AudioStream/Scripts/AudioSourceOutputDevice/FMODSystemOutputDevice.cs(24,46): error CS0234: The type or namespace name 'SOUND_PCMREADCALLBACK' does not exist in the namespace 'FMOD' (are you missing an assembly reference?)


    How can I fix up this compilation error? Thanks!
     
  47. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    Hello @graum,
    you can either use latest 1.10 major version, that is currently 1.10.15, of the Unity Integration ( you can pick a version from combobox on the download page )
    AudioStream is not yet updated for 2.0 on the store - sorry about that !

    - or fix it manually which should be simple: - I believe the callback signatures were just renamed - so SOUND_PCMREADCALLBACK became SOUND_PCMREAD_CALLBACK - you can see declarations in fmod.cs, and your IDE should help with IntelliSense too
    AFAIK these callbacks declaration used by AudioStream were the only thing which were incompatible between major versions

    Hope this helps! - let me know any time if there's something not clear
     
  48. pffelix

    pffelix

    Joined:
    Jul 1, 2019
    Posts:
    1
    Hello @r618

    I have an issue with the 2D recording functionality of the audiostream plugin. In particular I want to record a stereo microphone in realtime. When I use GetOutputData() on the recording audio source, as done in the Demo, I get distortions and cracks as the received audio array is not time synchronized. I read online that AudioFilterRead() is the correct approach. Can you tell me where to integrate this Callback function? It is not getting called when I simply add the function to the Demo script.
     
  49. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    892
    hi @pffelix

    yea GetOutputData is not suited for getting final/clean signal in Update (in demo it's there just to get energy per frame)
    , to get the audio filter, the component in which OnAudioFilterRead method is implemented must be attached to the same game object as the AudioSource which audio is to be captured
    so in your case, attach your component to the same game object as AudioStreamInput2D script is attached to
    (AudioStreamInput2D has the OnAudioFilterRead implemented, too, where the signal is being produces for Unity to play)
    notice the 'AudioSourceMute' script attached under the component in the demo scene - use this, too, otherwise you'll get feedback loop on your input
    - you might want to make sure AudioSourceMute is below your component in the Inspector so it will be run later/last on the game object

    Let me know if you can work this out this way
     
  50. Yuuki-Mochiduki

    Yuuki-Mochiduki

    Joined:
    Nov 29, 2012
    Posts:
    11
    When I change output device from default to others, it succeed to change the audio output device. But, on built app, when I close the app, it does not close correctly. On editor, after I stop to play once, the editor will not start correctly at next time.
    What do I have to do workaroud it?

    My environment:
    Windows 10, Unity 2018.4.6f1, AudioStream v1.9, FMOD 1.10.14
     
unityunity