I am getting error

pa_simple_new() failed: Connection refused

while trying to call pa_simple_new function. Here is the code.

int error;
static const pa_sample_spec ss = {
    .format = PA_SAMPLE_S16LE,
    .rate = 44100,
    .channels = 2
};

/* Create the recording stream */
if (!(m_pAudioIn = pa_simple_new(NULL, "APPNAME", PA_STREAM_RECORD, NULL, "record", &ss, NULL, NULL, &error)))
{
    fprintf(stderr, "pa_simple_new() failed: %s\n", pa_strerror(error));
    return -1;
}
有帮助吗?

解决方案

Reinstalling PulseAudio fix the issue

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top