Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by JeMhUnTeR · Aug 05, 2013 at 07:13 AM · inputaudioaudiosourcemusic

Stereo Mix as Input?

So. I was wondering if it was possible to use the Stereo Mix as an AudioSource. I'm experimenting with stuff, and right now I'm making audio visualizers. Is there any way of using the Stereo Mix or the entire system audio output as my AudioSource for visualizing instead of just loading an AudioClip resource from within Unity?

External links and noob tutorials will be highly appreciated. :)

Also, sorry if this is a duplicate, since I'm really really bad at searching.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by gregzo · Aug 05, 2013 at 07:23 AM

Check out OnAudioFilterRead, it gives you access to post spatialisation audio data. It needs to be implemented on an object which has either an AudioSource, or an AudioListener, in which case you'll get the total mix from the listener's pov.

It is not well documented, so here are a few tips :

OnAudioFilterRead on a mono AudioSource will give you stereo data ( if your audio settings are set to stereo, of course ). But... it will give you spatialized data - meaning that gain and pan will vary depending on the AudioListener's position relative to the AudioSource.

Note that data you access is pre AudioReverbZone transformation.

Pipeline Summary : Mono 3D AudioClip ( read/write access through GetData / SetData ) -> AudioSource processes the clip's data to spatialize it -> OnAudioFilterRead access -> AudioReverbZone processes last

Last, OnAudioFilterRead is on a seperate (faster) thread. Special care is required, and you cannot call UnityEngine methods from it.

Hope it helps!

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image JeMhUnTeR · Aug 05, 2013 at 08:03 AM 0
Share

I was asking if it was possible to visualize ALL system sounds. For example, if I play music with iTunes or any other player, my Unity build could read audio from these sources.

Anyway, this helped me a lot in some other aspect. I could probably just stick with this since I'm just experimenting stuff. Thanks :) (yes, any random information is useful for me since I'm still on my way to learning Unity)

But I'm still waiting for an answer for my real issue. :-bd

avatar image gregzo · Aug 05, 2013 at 09:36 AM 0
Share

Sorry for the misunderstanding. You need a plugin to capture system sound. I don't think there are any in the asset store, but surely some C# code can be found on the web somewhere. You'll then need Unity Pro - Plugins are not supported in Free.

Also, the code you'll find will most probably be system specific.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

14 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Can not play a disabled audio source 2 Answers

Multi Channel Audio 4 Answers

Specifying OnAudioFilterRead()'s audiosource 1 Answer

Glitched Music 0 Answers

Change music during chase 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges