LitDev.LDSound.Stop C# (CSharp) Method

Stop() public static method

Stop and save current sound recording.
public static Stop ( Primitive wavFile ) : Primitive
wavFile Primitive The full path to a wav file to save the recording. /// The extension will be set to ".wav" if it is not already.
return Primitive
        public static Primitive Stop(Primitive wavFile)
        {
            if (!bRecording) return "FAILED";
            wavFile = Path.ChangeExtension(wavFile, ".wav");
            Utilities.ClearMediaPlayer(wavFile);
            wavFile = "\"" + wavFile + "\"";
            int iRet = 0;
            iRet |= mciSendString("save recsound " + wavFile, "", 0, 0);
            iRet |= mciSendString("close recsound ", "", 0, 0);
            bRecording = false;
            return iRet == 0 ? "SUCCESS" : "FAILED";
        }