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
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.
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?
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.
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.
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
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?
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
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 :)
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.
@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)
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?
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,
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.
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
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 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?
@@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.
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
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 >.
@@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.
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.
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.
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?
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..
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
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
thx)
that voice of you with echo + visualisation is fucking cool !
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?
Very cool dude! Glad to see a fellow Unity programmer.
Thank you so much for this tutorial!
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?
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.
Very cool! When is the next part? :)
@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
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?
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.
while (!(Microphone.GetPosition(_selectedDevice) > 0)) { } // Add this line
_audioSource.Play();
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.
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.
@@albertthorval4674 this video is deleted ? ı cant open it
Nice Job Man but can you teach me how to change the colours when input is detected
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
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?
while (!(Microphone.GetPosition(_selectedDevice) > 0)) { } // Add this line
_audioSource.Play();
what audio clip you put in the script variable its out of screen
wow....you are really great. im really thank you so much.... you are the best.
You are really really amazing !!!!
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
Hey ! I'm a huge fan of your work! Really amazing stuff man!
Why did you discontinue this series ??
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 :)
Please make part 2 :-)
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.
Genius!! Thanx a lot, dude!!
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?
@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)
while (!(Microphone.GetPosition(_selectedDevice) > 0)) { } // Add this line
_audioSource.Play();
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?
Hiya, i'm getting an error that i'm missing mono ( script )
Could you point me in the right direction to fix this?
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,
Please make a video of how to make mic audio input send over lan or clients connected please
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.
Woooww spectacular
2:07 why you didn't just put an else to there?
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
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!
unity's microphone records the input voice in an audio clip.
you can write code to save that audio clip in a .wav file.
@@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?
@@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.
@@usernotfound6407 Can I not just set the microphone to be the phone's output? Like selecting the "Stereo Mix" microphone on Windows
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
while (!(Microphone.GetPosition(_selectedDevice) > 0)) { } // Add this line
_audioSource.Play();
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?
Did you manage to fix it?
@@ViperDznHQ Well.. did YOU manage to find a fix? I am still looking
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 >.
@@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.
@@ViperDznHQ Add this to Update()
if (_useMicrophone && !_audioSource.isPlaying)
{
_audioSource.Play();
}
what happens if instead of the microphone i want to just upload an audio file?
use system.io
thank u a lot
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.
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.
Hi Gustavo,
Am facing the exact same problem. Did you manage to solve this issue? Would like to hear back from you.
Thanks.
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?
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..
Hi< thx for your work, I want ask to you about something help for me.
Can I get the source code please?
source code is available at Patreon, when you become a patron.
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...
That was covered in a previous series.