Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
0
Question by benjaminoutram · Nov 12, 2015 at 09:50 AM · movementsoundaudiosourcemicrophoneaudiolistener

Mac built-in microphone stopped sending data to Unity.

I have been using the below script to get in-put from the built-in microphone to the audiosource.

Up until now it has worked perfectly, but recently when trying to clear space on my mac by deleting an old Unity4 instillation, I accidentally deleted Unity5 from my computer and tried opening on Unity4. Unity4 recompiled my project, before I realised what had happened. I deleted Unity4 and re-downloaded and installed Unity5, and again it recompiled my project.

But now, although everything seems to look exactly the same and run exactly the same way as before all this, there is no data coming in from the microphone at all, just nothing. It lists the microphone and assigns it to the audiosource fine, but its as if the mic is outputting nothing. I have tested the mic on other programs and it is functioning normally. I also tried opening my project on another instillation of Unity5 on a Windows system, and it has the same problem. I have not changed the code at all. I am not sure if the switching around between Unity versions has caused the problem or not. I have been searching for the solution, but I am stumped! Any help would be sincerely appreciated.

 using UnityEngine;
 using System.Collections;
 
 [RequireComponent(typeof(AudioSource))]
 public class MicrophoneListener : MonoBehaviour {
 
     public float sensitivity = 100;
     public float loudness = 0;
     
     void Start() {
 
         foreach (string i in Microphone.devices) {
             Debug.Log (i);
         }
 
         GetComponent<AudioSource>().clip = Microphone.Start(null, true, 10, 44100);
         GetComponent<AudioSource>().loop = true; // Set the AudioClip to loop
         GetComponent<AudioSource>().mute = true; // Mute the sound, we don't want the player to hear it
         while (!(Microphone.GetPosition(null) > 0)){} // Wait until the recording has started
         GetComponent<AudioSource>().Play(); // Play the audio source!
 
         //Debug.Log ("microphone script entered");
     }
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 benjaminoutram · Nov 12, 2015 at 11:33 AM 0
Share

Some extra information:

As you see in the script above, I mute the audiosource so that the mic input isn't output through the speakers. However, if I uncheck the 'mute' bool while it is running, then sure enough I get feedback and a response, I can even shout at the computer and it clearly is taking the information in. But as soon as I re-check the 'mute' button, again it goes to zero amplitude, nothing, in the audiosource. I loaded up an old backup of my project from way before all this happened, and it has the same problem, so I think it must be something to do with the latest version of Unity5.2.2? Someone please help!

0 Replies

· Add your reply
  • Sort: 

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

31 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

Related Questions

Max amount of simultaneous, hearable sounds? 1 Answer

Audio: -3db automatic attenuation on any audio playing? 0 Answers

Intensity of sound. -1 Answers

sound too low in Android devices 0 Answers

How to get decibel's value of game's sound? 0 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