Microphone Input Visuals - Unity/C# Tutorial [Part 1 - Get Microphone Devices]

Поділитися
Вставка
  • Опубліковано 10 лис 2024

КОМЕНТАРІ • 73

  • @quirkyfb
    @quirkyfb 4 роки тому +2

    To those who couldn't get the mic to work - is your mic unmuted - check in sound settings. And of course, did you miss out the _audioSource.Play() ... I did!
    I also had problems when I muted my mic submixer... However, if, like me you were using AudioListener.GetSpectrumData, change it to point to your audio source, as in _audioSource.GetSpectrumData

  • @MaxiCrows
    @MaxiCrows 4 роки тому +15

    i need to say two things to add:
    the using UnityEngine.Audio; in the begin
    and _audioSource.Play(); in the last partt of the void start
    your welcome

  • @achibaba
    @achibaba 6 років тому +2

    that voice of you with echo + visualisation is fucking cool !

  • @shotasawada1029
    @shotasawada1029 2 роки тому

    Thank you so much for making this wonderful video! I'm looking for the next one (Part2 - Get Microphone Devices), but how can I find it?

  • @ArtBySabin
    @ArtBySabin 6 років тому

    Very cool dude! Glad to see a fellow Unity programmer.

  • @LadyJuse
    @LadyJuse 3 роки тому +1

    Thank you so much for this tutorial!

  • @fabiuspeak
    @fabiuspeak 3 роки тому +1

    Great series of tutorials! It works great on desktop apps but not on Android devices. It appears as the microphone is not recording. Any suggestions?

  • @VisibleSounds_
    @VisibleSounds_ 4 роки тому +3

    Did you have to change any settings in unity to be able to read data from the mic input? My code is the same and I can see my device in the device list when running the script plus when i open sound settings in windows you can see the volume levels going up and down, just nothing happening within unity.

  • @sexypotato
    @sexypotato 3 роки тому +1

    Very cool! When is the next part? :)

  • @clarksmiley8031
    @clarksmiley8031 4 роки тому +1

    @Peer Play Will you be posting part 2 here or on your patreon? I would love to learn how to select different audio input devices

  • @theratscratch
    @theratscratch Рік тому

    So my external mic (a Focusrite audio interface) is detected by the system and I can see the levels and stuff, play it in Ableton, but in Unity I'm not seeing any data come through... Internal mic works just fine. Any ideas?

  • @CheeseM4ster23
    @CheeseM4ster23 Рік тому +2

    Hey I started using this tutorial for a project of mine and am running into an obstacle. When I start the project the microphone will have a few problems. Firstly it works with a huge robotic distortion and the level of this distortion varies greatly. The Other issue is sometime the micrphone audio will play back after the loop time is over and distorts the original audio terribly.
    A quick solution I've found is quickly diabling and enabling the Audiosource component, but that introduces a delay as along as the time disabled. Any advice would be appreciated.

    • @jason2li
      @jason2li 4 місяці тому

      while (!(Microphone.GetPosition(_selectedDevice) > 0)) { } // Add this line
      _audioSource.Play();

  • @chalulu
    @chalulu 5 років тому +1

    I have an issue. When I write the line with "_mixerGroupMicrophone", my microphone doesn't work. Could you help me ? Thank you so much for your tutorial.

  • @AceOnlineMath
    @AceOnlineMath 5 років тому +5

    Great videos. Can you possibly to a tutorial that involves live pitch detection? its really hard to research and i think it would be super cool.

    • @alican8245
      @alican8245 3 роки тому

      @@albertthorval4674 this video is deleted ? ı cant open it

  • @msnitro9532
    @msnitro9532 4 роки тому

    Nice Job Man but can you teach me how to change the colours when input is detected

  •  3 роки тому

    I am confused - this tutorial is not from scratch. I did some visualisation tutorial before that - but that was different. So I am not sure I can use this somehow. If I try to use this code for mic in old visualisation scrip it gives error.
    I think it wants to be something in that Audioclip

  • @denicetuinhof5575
    @denicetuinhof5575 4 роки тому

    A big thumbs up to all the work you put into this @Peer Play! The only problem I walk into is that my Audio isn't as clear as yours (even after the Audio Mixer) and in addition I have a long latency. Is there something you did to fix this because my real time audio is at least 30 seconds delayed... Would you advise to use the Native library?

    • @jason2li
      @jason2li 4 місяці тому

      while (!(Microphone.GetPosition(_selectedDevice) > 0)) { } // Add this line
      _audioSource.Play();

  • @ya_boi929
    @ya_boi929 2 роки тому

    what audio clip you put in the script variable its out of screen

  • @아니듀걸
    @아니듀걸 5 років тому

    wow....you are really great. im really thank you so much.... you are the best.

  • @dushyantsingh2624
    @dushyantsingh2624 5 років тому

    You are really really amazing !!!!

  • @DEADEYESTUDIO
    @DEADEYESTUDIO 4 роки тому

    hey, you woudlnt happen to know if it's possible to use the same microphone for 2 different audio sources on 2 objects would ya? and if so how? ive been struggling to figure out how to do this for weeks

  • @jkleo203
    @jkleo203 6 років тому +2

    Hey ! I'm a huge fan of your work! Really amazing stuff man!
    Why did you discontinue this series ??

    • @PeerPlay
      @PeerPlay  6 років тому +3

      i have no clue actually. It's the only series I didn't complete :o I guess I was suddenly intrigued into something else at that point. But thanks for the kind words :)

    • @MrTjahzi
      @MrTjahzi 6 років тому +2

      Please make part 2 :-)

  • @uditkhiraiya2201
    @uditkhiraiya2201 6 років тому +1

    Hey this is great ! Thank you. Is there a way we can use a multi channel audio interface and analyze input from a channel (either channel 1 or 2) ? I'm not sure if unity provides the ability to read from a multichannel audio input source.

  • @inteligenciamilgrau
    @inteligenciamilgrau 5 років тому

    Genius!! Thanx a lot, dude!!

  • @I3ra
    @I3ra Рік тому

    I'm late to the part but does anyone know why when I invoke the method in Start() it seems to work but when I invoke on GUI it doesn't?

  • @originalnick473
    @originalnick473 4 роки тому

    @Peer Play Hey!! Frist of all - thanks for the video, even tho it is old it heaped me out a *lot*. I know you are most probably busy, so I'll try to keep it short - How do I reduce the latency of the sound coming in and visualizer doing its thing? (I am trying to make a game, which takes the users input and depending on the loudness makes a ball go up and down, so I really don't need the visualizer, but I do need the mic input with no delay)

    • @jason2li
      @jason2li 4 місяці тому

      while (!(Microphone.GetPosition(_selectedDevice) > 0)) { } // Add this line
      _audioSource.Play();

  • @colinyan742
    @colinyan742 5 років тому

    It is amazing, thanks for sharing.I am a beginner for unity,I want to know that can i use the voice volume to control the object position? is it difficult? Can you give me some suggestions?

  • @MrTjahzi
    @MrTjahzi 6 років тому

    Hiya, i'm getting an error that i'm missing mono ( script )
    Could you point me in the right direction to fix this?

  • @CMBAPsychopath
    @CMBAPsychopath 5 років тому

    Would you be kind enough to explain how you get that _useMicrophone boolean ? Is there any easy way to get the fact that the mic is being used, or is that the rest of your code?
    Cheers,

  • @zahmunjie8152
    @zahmunjie8152 4 роки тому

    Please make a video of how to make mic audio input send over lan or clients connected please

  • @Jc-vh7zm
    @Jc-vh7zm 6 років тому

    I occurred a problem that my microphone input can make the visualizer work, but i cannot hear the real-time microphone sound through the output. I don;t know how to deal with it.

  • @salvatorebutera7453
    @salvatorebutera7453 5 років тому

    Woooww spectacular

  • @progCan
    @progCan Рік тому

    2:07 why you didn't just put an else to there?

  • @tataygamesPH
    @tataygamesPH 5 років тому

    You must not include the sourcecode in your discription because we need to pay before downloading it is password protected. anyway thanks for the turorial

  • @Matdrox
    @Matdrox 4 роки тому +3

    Has anyone figured out how to set the output as the microphone so that it records the sound coming directly from the device? It would mean a lot to me if anyone tells me how to achieve this!

    • @usernotfound6407
      @usernotfound6407 4 роки тому +1

      unity's microphone records the input voice in an audio clip.
      you can write code to save that audio clip in a .wav file.

    • @Matdrox
      @Matdrox 4 роки тому +1

      @@usernotfound6407 I'm sorry but I don't really understand what I am supposed to do, this is the first time I code something other than a game in Unity. What I want to achieve is the music playing from the phone via Spotify to be detected instead of the microphone. How do I find that audio clip and turn it into a .wav file?

    • @usernotfound6407
      @usernotfound6407 4 роки тому +1

      ​@@Matdrox well, i don't know about the spotify part because i have never done that. i know there are some api's and unity assets that let you log into spotify.
      if you be able to play a music from spotify in unity, you probably have access to the samples of that music.
      samples are the information about the audioClip/Music
      and those are everything, if you have access to them, you can write them into a .wav file.
      first try to find a way to access to the samples of the music that is playing (if you can)
      then hit me in here and i'll tell you how to write samples into a .wav file.

    • @Matdrox
      @Matdrox 4 роки тому +1

      @@usernotfound6407 Can I not just set the microphone to be the phone's output? Like selecting the "Stereo Mix" microphone on Windows

  • @eromargomes4415
    @eromargomes4415 3 роки тому

    I am in need of help to reproduce my voice in real time already tried several always plays with delay
    anything let me know if you can help me and how much it would cost me

    • @jason2li
      @jason2li 4 місяці тому

      while (!(Microphone.GetPosition(_selectedDevice) > 0)) { } // Add this line
      _audioSource.Play();

  • @seewai
    @seewai 6 років тому +6

    My microphone input seems to stop working after the 10 seconds is up even though I have loop set to true. Any ideas on why that might be happening?

    • @ViperDznHQ
      @ViperDznHQ 4 роки тому +1

      Did you manage to fix it?

    • @LurkerPurker
      @LurkerPurker 3 роки тому

      @@ViperDznHQ Well.. did YOU manage to find a fix? I am still looking

    • @LurkerPurker
      @LurkerPurker 3 роки тому +2

      Okay nevermind I am dumb.
      audioSource.clip = Microphone.Start(selectedMicrophone, true, 10, AudioSettings.outputSampleRate);
      We set the time to 10. So of course after 10 seconds it will stop. Jesus.. coding >.

    • @ViperDznHQ
      @ViperDznHQ 3 роки тому

      @@LurkerPurker That wasn't the fix for me, the 10 seconds shouldn't be the issue as we have loop set to true. I've not touched this in a few months so I'm not sure what I did.

    • @mohdnaim2533
      @mohdnaim2533 3 роки тому +1

      @@ViperDznHQ Add this to Update()
      if (_useMicrophone && !_audioSource.isPlaying)
      {
      _audioSource.Play();
      }

  • @Delalumiere666
    @Delalumiere666 5 років тому

    what happens if instead of the microphone i want to just upload an audio file?

  • @thanhtungnguyen6200
    @thanhtungnguyen6200 4 роки тому

    thank u a lot

  • @gustavooes2382
    @gustavooes2382 7 років тому

    Hi! I did the same thing that you did, but my mic does'nt affect the bands, my mic is showing as selected device. I tested if is recording and result is true... I also check the value of the bands and the numbers are pretty strange.

    • @PeerPlay
      @PeerPlay  7 років тому

      That is pretty strange. You can send me your complete AudioPeer.cs file to info AT peerplay DOT nl , so I can quickly test if there is something wrong in your script. ;) Or send me your project in a zip, whatever works best.

    • @rupeshmandke
      @rupeshmandke 7 років тому

      Hi Gustavo,
      Am facing the exact same problem. Did you manage to solve this issue? Would like to hear back from you.
      Thanks.

    • @PeerPlay
      @PeerPlay  7 років тому +1

      The only reason I could imagine it not working if you followed all the steps of the tutorial, is if your not working on Windows... as I don't have a Mac, I've never actually tested it on mac. If you are working on Windows, I'm clueless aswell. Could your Audio Source be muted for some reason?

    • @rupeshmandke
      @rupeshmandke 7 років тому

      Hi Peer Play, first of all thanks for these wonderful tutorials & also quick response. Source code & scene setup is exactly the same, not sure why microphone input is never detected. Rest of the apps dependent on microphone seems to be working fine (like recorder etc.) This is for Windows only. Am going to dig more into way Microphone is handled in Unity because without it everything works as expected. Am not sure, but do you think calling Microphone.Start only once in Start() function is enough for recording to happen? When does system converts what is recorded into AudioClip to be processed by rest of the code? I will keep you posted if I figure out what is wrong with my project..

  • @ТонРев
    @ТонРев 5 років тому

    Hi< thx for your work, I want ask to you about something help for me.

  • @ahmedthebest
    @ahmedthebest 6 років тому

    Can I get the source code please?

    • @PeerPlay
      @PeerPlay  6 років тому +1

      source code is available at Patreon, when you become a patron.

  • @rene7702
    @rene7702 5 років тому

    i miss the beginning of creating the circle, camera, position and script set up. Not everybody is a advance unity programmer. Start with the basics...

    • @BOOMADAM
      @BOOMADAM 5 років тому

      That was covered in a previous series.