libsndfile - Error using WASAPI with PortAudio on Win7 -


I am trying to use PortAudio and libsndfile to run WAV files in unique mode on my Windows 7 machine , Error number-9984 "Incompatible Host API Specific Stream Info".

I have filled the PaWasapiStreamInfo struct in such a way:

  Structure Pavaspeptream InfoIpiaInfo; WasapiInfo.size = sizeof (PaWasapiStreamInfo); WasapiInfo.hostApiType = paWASAPI; WasapiInfo.version = 1; WasapiInfo.flags = paWinWasapiExclusive; WasapiInfo.channelMask = NULL; WasapiInfo.hostProcessorOutput = NULL; WasapiInfo.hostProcessorInput = NULL; WasapiInfo.threadPriority = eThreadPriorityProAudio;   

Then specify the hostApiSpecificStreamInfo parameter and open the stream via Pa_OpenStream like this:

  / * stereo or mono * / out_prim.ChannelCount = sfinfo .channels; Out_param.sampleFormat = paInt16; Out_param.SuggestedLatency = _GetDeviceInfo (out_param.device) - & gt; Default standard output latency; Out_param.hostApiSpecificStreamInfo = (and wasapiInfo); Err = Pa_OpenStream (& amp; stream, NULL, & amp; out_param, sfinfo.samplerate, paFramesPerBuffer is not specified, paClipOff, output_cb, file);        

text ">

The technique you can use in unique mode Used to run streams, it worked for me, it may be that you are not opening a stream on a WASAPI device. Depending on your system configuration, you may also have DirectSound and WMME devices. The code will confirm whether the index is a device or a WASAPI device referenced by deviceIndex :

  bool isWasapi = Pa_GetHostApiInfo (Pa_GetDeviceInfo (deviceIndex) - & Gt; hostApi) -> Type == paWASAPI;   

You must also specify the same index in the Out_form structure:

  out_param. Device = deviceIndex;   

You did nothing that I did not try to set thread priority in your example, but PortAudio documentation tells the following line: < Pre> wasapiInfo.threadPriority = eThreadPriorityProAudio;

will not have any effect because you set paWinWasapiThreadPriority bit in wasapiInfo.flags did not do. With the same rule it is unnecessary to clearly clear the other varaibles. To fix this set, wasapiInfo.flags is as follows: wasapiInfo.flags = (paWinWasapiExclusive | paWinWasapiThreadPriority)

It should be enabled, the unique mode and effect causes the thread priority variable to apply.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -