Answer the question
In order to leave comments, you need to log in
How to record sound from a computer?
Hello everyone, you are my last hope.
I'm trying to programmatically record the sound that I hear from the computer (internal output). I have already tried all the devices, all combinations in portaudio - the sound is recorded only from the microphone. However, the SoundWire software uses PortAudio to record internal audio. I opened it in IDA - configuration result:
input_parameters.device = Pa_GetDefaultInputDevice();
input_parameters.channelCount = 2;
input_parameters.sampleFormat = paInt16;
const PaDeviceInfo *input_info = Pa_GetDeviceInfo(input_parameters.device);
input_parameters.suggestedLatency = input_info->defaultLowInputLatency;
input_parameters.hostApiSpecificStreamInfo = NULL;
Pa_OpenStream(&stream, &input_parameters, NULL, input_info->defaultSampleRate, paFramesPerBufferUnspecified/*на самом деле тут 338u(которая скорее всего ссылка на sampleRate) и 1(флаг либо 1 семпл на 1 вызов), я решил что на результат не повлияет*/, paClipOff, recordCallback, NULL);
int16_t *in = (int16_t *) inputBuffer;
for(int i = 0; i < LEN(in); i++) {
cout << in[i] << ":";
}
cout << endl;
Answer the question
In order to leave comments, you need to log in
See how sound is captured by OBS Studio. True, it works through PulseAudio.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question