Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi all, Is possible to record audio with Irrklang on C? i try do it, and on thread i get sample data,but is always zero-size, is possible to do this? i wrote somethink like this void IrrKlangRecv() { while (true) { if (engine == null || recorder == null) { Thread.Sleep(10); continue; } if (recorder.AudioFormat.SampleDataSize <= 0) {continue;} Debug.Print("DataS: {0}", recorder.AudioFormat.SampleDataSize); Thread.Sleep(10); if (FileChkBox.Checked && recorder != null && writer != null) writer.Write(recorder.RecordedAudioData, 0, recorder.AudioFormat.SampleDataSize); recorder.ClearRecordedAudioDataBuffer(); // bufferedWaveProvider.AddSamples(recorder.RecordedAudioData, 0, recorder.RecordedAudioData.Length); // meteringSampleProvider.Read(recorder.RecordedAudioData, 0, recorder.RecordedAudioData.Length); } } |
||||
|
Yes, that one will always be 0, this is only for getting the audio format. If you are finished recording, just do a StopRecordingAudio(). Then, what was recoded is in RecordedAudioData . |
|