Note that there are some explanatory texts on larger screens.

plurals
  1. POC++ and pulseaudio "not declared in this scope"
    text
    copied!<p>I'm trying to use pulseaudio to play the contest of a vorbis-stream but are hitting problems. Basicly I'm told that:</p> <pre><code>‘pa_simple’ was not declared in this scope ‘pa_simple_new’ was not declared in this scope ‘pa_simple_write’ was not declared in this scope </code></pre> <p>Some code are shown below:</p> <pre><code>#include &lt;pulse/pulseaudio.h&gt; </code></pre> <hr> <pre><code>pa_simple *s; pa_sample_spec ss; ss.format = PA_SAMPLE_S16NE; ss.channels = 2; ss.rate = 44100; s = pa_simple_new( NULL, // Use the default server. "Fooapp", // Our application's name. PA_STREAM_PLAYBACK, // Playback NULL, // Use the default device. "Music", // Description of our stream. &amp;ss, // Our sample format. NULL, // Use default channel map NULL, // Use default buffering attributes. NULL, // Ignore error code. ); </code></pre> <hr> <pre><code>while((samples=vorbis_synthesis_pcmout(&amp;vd,&amp;pcm))&gt;0){ int j; int bout=(samples&lt;convsize?samples:convsize); cout &lt;&lt; "D" &lt;&lt; endl; for(i=0;i&lt;vi.channels;i++){ ogg_int16_t *ptr=convbuffer+i; float *mono=pcm[i]; for(j=0;j&lt;bout;j++){ int val=floor(mono[j]*32767.f+.5f); *ptr=val; ptr+=vi.channels; } } cout &lt;&lt; "E" &lt;&lt; endl; #ifdef PulseAudio pa_simple_write(s,convbuffer,2*vi.channels,NULL); #else fwrite(convbuffer,2*vi.channels,bout,output); #endif vorbis_synthesis_read(&amp;vd,bout); cout &lt;&lt; "F" &lt;&lt; endl; } </code></pre> <p>It's probably some simple error, but if anyone could point me into the right direction, that would be great!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload