how do i set output of submix voice in XAudio2? (metro) - audio

I tried using the SetOutputVoices function, and the constructor parameter, but both result in a XAUDIO2_E_INVALID_CALL as the result when used on a submix voice.
the docs say that you get that error by calling it from an audio callback, but i'm not. i have even tried calling it before starting the audio engine.
the same method works for source voices, so i'm pretty sure i'm not passing a bad XAUDIO2_VOICE_SENDS structure.

Submix voices have a processing order, specified by the processingStage parameter in IXaudio2.CreateSubmixVoice
You can only send output to a submix voice with a lower processing stage. and i had all of my submixes at the default processing stage (0).

Related

How to Fetch Recording from Onvif using javascript

I am trying to fetch the recording from a vivotek camera using onvif interface. I tried using the function exportRecordedData using the documentation http://www.onvif.org/ver10/recording.wsdl but there was no result.
I am getting error
2022-06-10T04:39:59.728Z error: exportRecordedData(): Error: Error: ONVIF SOAP Fault: Operation Action Not Implemented. The requested action operation is not implemented by the device.
I think ExportRecordedData() implementations might be rare (I think I don't have them on TVT an Uniview).
The other option is using RTSP stream as returned by GetRecordings(). For TVT there is also alternative url: rtsp://IP:port/chID=1&date=2020-03-09&time=17:00:00&timelen=100&StreamType=main. Both TVT and Uniview work with Range in RTSP PLAY when using URL from GetRecordings(), but both also have some problems - TVT plays all recordings as one stream (at least I cannot distinguish them at the moment), Uniview plays only first recording from specified range.

NiFi - InvokeHTTP not making GET calls while taking parameter from incoming FlowFile

I have an InvokeHTTP processor that makes a GET that accepts an author variable from an incoming FlowFile as input. However, InvokeHTTP does not appear to be doing anything with the input: https://www.pastepic.xyz/image/LKc34
I tested the Remote URL in a browser with an author from one of the input flowfiles, and it returns JSON as expected.
Remote URL: https://www.reddit.com/user/${author:urlEncode()}/comments/.json?limit=100
Data Provenance shows only DROP and ATTRIBUTES_MODIFIED events. Shouldn't there be FETCH, CLONE, and/or FORK events?
The author from the incoming FlowFile is in those DROP and ATTRIBUTES_MODIFIED events. The input processor is an EvaluateJsonPath whose only output is the author field, and the property name is author.
Also, I tested hardcoding a username in the Remote URL and disconnecting the input FlowFile. That worked and made the request as expected, returning output. So appears there's something wrong with the interaction between the input FlowFile and InvokeHTTP.
I should be getting back JSON from InvokeHTTP. But it appears that the requests are not being made in the first place, failing silently so to speak. Read/Write and Out are empty, and I'm not getting errors.

What kind of object does the `pipe` method accept?

I have the following code:
process.stdin.pipe(output).pipe(socket);
I want to modify the contents of output before it is piped into socket. I need to add an additional pipe in between the two, but I am not sure how to do that. I checked the documentation on Streams but I could not figure out how to create my own method to invoke pipe with that will intercept the current pipeline.
What kind of object does the pipe method accept?

What is the proper way to raise an exception for invalid property settings?

I am writing a component that reads data from a specific filetype. Currently, it has a property for filepath - I would like for this block to quit as hard as possible when passed an invalid file/no file found.
Throwing an exception causes it to stop execution, but also deletes the block from the chalkboard while I am testing (?), which makes me think there is a more "approved" way to do it.
My current solution is something like:
LOG_ERROR( MyReader_i, "Unable to open file at " + Filepath );
return FINISH;
Is there another way to stop if something is wrong, that will hopefully stop all downstream processing as well?
Have you taken a look at the Data Reader component in the basic components? It also has a file path as an input. It deals with this during the onConfigure call as shown below:
def onconfigure_prop_InputFile(self, oldvalue, newvalue):
self.InputFile = newvalue
if not os.path.exists(self.InputFile):
self._log.error("InputFile path provided can not be accessed")
And then again in the service function by returning NOOP.
def process(self):
if (self.Play == False):
return NOOP
if not (os.path.exists(self.InputFile)):
return NOOP
This isn't the only way to deal with invalid input however. It's a design decision that is up to the developer.
If you'd like additional components down stream to know about an issue elsewhere in the chain, you have a few options. You could use the End of Stream bit, available in bulkio port implementations, to signal to down stream components that there is no additional data. They can then use this information to clean up and shut down. You could also use messaging to send a message out to an event channel and anyone who has subscribed to this event channel can be made aware of the message. Again, it's a design decision.

Can MessageChannel overflow

I am working on an AS3 project in FDT6. I am using the lastest FLEX 4.6 and AIR 3.7.
I have a worker.swf file that is embedded into the main application to do threading work with.
I am using the MessageChannel class to pass information between the two.
In my main class I have defined
private var mainToWorker:MessageChannel;
private var workerToMain:MessageChannel;
mainToWorker = Worker.current.createMessageChannel(worker);
workerToMain = worker.createMessageChannel(Worker.current);
on the mainToWorker I only ever send messages. In these messages I send a byte array of information. The information is an object that contains a 'command' property and a 'props' property. Basically acting like a function call. The command is a function name and the props is an object that contains data for that function.
mainToWorkerMutex.lock();
mainToWorker.send(ByteArrayUtils.ObjectToByteArray({command:"DoSomething", props:{propA:1,propB:7}}));
mainToWorkerMutex.unlock();
The same occurs for the workerToMain var except I only send byte data that contains the 'message' and 'props' parameters.
workerToMainMutex.lock();
workerToMain.send(ByteArrayUtils.ObjectToByteArray({command:"complete", props:{return:"result"}}));
workerToMainMutex.unlock();
As a sanity check I make sure that the message channels are getting what they should.
It is working fine when I build it in FDT, however when it is built using an ANT script through flash builder I am sometimes getting the 'command' events coming back through in the workerToMain channel.
I am sending quite a lot of data through the message channel. Is it possible that I am overloading it and causing a buffer overflow into the other message channel somehow? How could that only be happening in FB?
I have checked my code many times and I am sure there is nothing in my own code that is sending that message back.
I had similar issue. When sending many bytearrays using channels sometimes things i received was not things i've actually sended. I had 4 channels (message channel to worker, message channel to main, data channel to worker, data channel to main).
I've noticed that data channel to main was affecting message channel to worker. When i turned off data channel to main - message channel to worker stared working just fine :D...
They have a big issue there with sending byte arrays it seems.
But what helped me was using shareable (at first it was not shareable) bytearray for communication via channels, but only for communication, as soon as i am receiving such bytearray i'm copying it to another byte array and parsing a copy.
This removed the problem (made quite hard stress tests there)...
Cheers
P.S. I'm also using static functions (like your ByteArrayUtils) to create bytearray's used for communication, but it seems fine, even made tests using non static functions.
So, it looks like I have found the issue. Looks like it's the ByteArray that is doing it.
ByteArray.toString() is basically sometimes mangles your data meaning you can't really trust it.
http://www.actionscript.org/forums/showthread.php3?t=155067
If you read the comment by "Jim Freer" he mentions how strings sometimes do this.
My solution was to switch to using a JSON encoded string instead of ByteArray data in the message channel. The reason I was using bytearray data to begin with is because I wanted to preserve class definition information, which JSON doesn't do.

Resources