Dear all,
I am trying to use UOS library.
The objective is to record the sound from my microphone.
To store the sound in a buffer.
Then to display the signal in a chart (like an oscilloscope).
The code below does not work at all. => But I don't know why?
uos_CreatePlayer(SoundPlayerIndex);
SampleRate := 44100;
SampleFormat := 2; // Int16
Channels := 1; // Mono
FramesCount := 65536;
// saving in a Memory-Buffer:
SetLength(SoundBuffer, 0);
uos_AddIntoMemoryBuffer(SoundPlayerIndex, @SoundBuffer, SampleRate, SampleFormat, Channels, FramesCount);
uos_AddFromDevIn(SoundPlayerIndex);
uos_Play(SoundPlayerIndex);
sleep(3000); // Duration of recording (I don't know?)
uos_Stop(SoundPlayerIndex);
ShowMessage('Recording done');
// Diplaying in a chart
ChartSignalLine.Clear;
for p := Low(SoundBuffer) to High(SoundBuffer) do
ChartSignalLine.AddXY(p/SampleRate*1e3, SoundBuffer[p]);
Other question, how can I do that if the recording has 2 channels?
Many thanks in advance for your reply