Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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
2
Question by HungryFox · Sep 12, 2017 at 05:18 PM · audiolistenersource

Getting Unity to listen to desktop audio

This probably doesn't have an easy solution, but I'm working on a music visualizer. Currently, it has some preloaded tracks is uses for the audio, but I'd like the app to be able to use any audio the user has playing on their computer. For example, they can run the app then go to Youtube and play any song they want. The app will listen to that audio. Essentially, I want the app to be able to use the desktop audio as the audio source. Is there an existing plugin I can use or some other method to do this? Preview of the project: https://www.youtube.com/watch?v=f-XGgs0jHl8

TLDR: How do I make Unity listen to the desktop audio and use it as the audio source? NOTE: I've been writing this program in C#.

EDIT: Looks like what I need specifically is to give Unity "WASAPI Loopback Capture," at least for Windows. It would be nice if I could get this to work on OSX as well, but it's a start.

Comment
Add comment · Show 1
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 MisterBlackCat · Sep 12, 2017 at 08:52 PM 0
Share

https://github.com/filoe/cscore

This might be of some use.

2 Replies

· Add your reply
  • Sort: 
avatar image
4

Answer by hallidev · Oct 27, 2017 at 12:53 PM

I'm not sure where you ended up with this, but I've been playing around with a visualizer of my own, and I wanted the same thing.

I used the excellent CSCore library (https://github.com/filoe/cscore) to accomplish it. It's capable of visualizing "what you hear" (WASAPI Loopback Capture). I came across this while searching for a way to feed the raw audio data into a Unity AudioSource since I'm too lazy to write my own beat detectors and all of the Asset Store assets work off AudioSource. If you're just interested in spectrum data though, it works great. I don't have a problem sharing it with you.

If you're still interested, reply here and I'll put something together for you.

Edit: Since OP showed interest, here's a working example

https://github.com/hallidev/UnityWASAPILoopbackAudio

Comment
Add comment · Show 5 · 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 HungryFox · Oct 27, 2017 at 03:37 PM 0
Share

Yeah, I'd love to see the code you used to accomplish this! To get the visualizer working I followed a tutoral by PeerPlay on Youtube. I'm not as code-savvy as I'd like to be so seeing examples really helps.

avatar image hallidev HungryFox · Oct 27, 2017 at 04:05 PM 1
Share

Sure thing. I'm at work now (slow day as you can see) but plan on playing with my visualizer tonight. I'll post a barebones example project to GitHub for you and anyone else interested. It should be a "get project loaded in Unity and press play to see it working" type thing.

avatar image hallidev HungryFox · Oct 27, 2017 at 06:45 PM 1
Share

I provided a link to a working example in my edit. Hope it's what you're looking for!

avatar image Alosh · Jan 23, 2019 at 11:00 AM 1
Share

I have had the same challenge and your shared project is surely going to help a lot, thank you and cheers!

avatar image thomasrafty · Aug 24, 2020 at 10:57 AM 0
Share

Hey mate tips for editing your Gihubtomake it more responsive? lag intervals admiss the projects,..

avatar image
2

Answer by sonofbryce · Sep 14, 2017 at 11:04 PM

I think the asset "AudioStream" will allow you to do this: https://assetstore.unity.com/packages/tools/audio/audiostream-65411

Comment
Add comment · 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

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

89 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 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 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 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 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 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 avatar image avatar image avatar image avatar image avatar image

Related Questions

Audio Sources and Listeners low sound volume problem 1 Answer

Volume rolloff: Distance to listener not changing. 3 Answers

Music goes crazy on rotating camera? 1 Answer

Networked Audio Listeners 2 Answers

Audio source not playing 7 Answers


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