- Home /
Question by
juliens137 · Jul 06, 2018 at 10:00 PM ·
audioaudioclipmicrophone
Microphone Position goes larger than predetermined number of samples
Hi,
I am attempting to analyze audio data in real time by analyzing the data stored in the audio clip from the microphone. The number of samples in the clip is determined by the sampling rate and the recording time, which with 1 second of recording at 44100Hz is just 44100 samples. The microphone position, however, during recording reaches all the way past 45000 samples, which is making it very difficult to link things together. Here is some example code:
void FixedUpdate()
{
if(!Microphone.IsRecording("")){
Debug.Log(Microphone.GetPosition(""));
oldData = data;
StartMic();
}
position = Microphone.GetPosition("");
isRecording = Microphone.IsRecording("");
clip.GetData(data, 0);
Debug.Log(position);
}
private void StartMic(){
clip = Microphone.Start("", false, 1, 44100);
}
Thank You
Comment
Your answer
Follow this Question
Related Questions
How to record audio in chunks and send through websocket? 0 Answers
Is it possible to select channels for the microphone input? 0 Answers
Microphone input to Audio Clip. 4 Answers
Multiple Microphone Inputs 0 Answers
Microphone capture different channels 0 Answers