Hi All, I’m working on an app where I need to record my voice and play it back. When the input is sustained (e.g. a long whistle or continuous singing) there is a problem where the recording fades out after 1-2 seconds. So when playing back the recording the audio is perfect for 1-2 seconds and then the volume seems to fade to 0 over the course of around 1 second. If I make a sustained sound for a time, pause, and then repeat, the same thing happens twice - fine at first and then fade.
I’ve tried this with 2 microphones and with the app below and a 3rd party app (MicControl 2 demo). Getting the same each time.
Setup - Unity 5.4.1, Windows 8.1
Any thoughts before I submit this as a bug?
using UnityEngine;
using System.Collections;
[RequireComponent(typeof(AudioSource))]
public class MicrophoneTest : MonoBehaviour
{
AudioSource src;
void Start ()
{
src = GetComponent<AudioSource>();
}
void Update ()
{
if (Input.GetKeyDown(KeyCode.F1)) // start recording with F1
{
src.clip = Microphone.Start(null, true, 10, 44100);
}
if (Input.GetKeyDown(KeyCode.F2)) // Stop recording and play with F2
{
Microphone.End(null);
src.Play();
}
}
}