Closed yura415 closed 9 years ago
Hi @yura415,
Assuming you're using Flocking 0.1.5, you can access Flocking's output stream via the outputStream
member of the environment's audioStrategy
object. Here's an example:
var enviro = flock.init();
var outputStream = enviro.audioStrategy.outputStream;
This API will change in Flocking 0.2.0 (which hasn't yet been released) due to factoring improvements I've been making. The outputStream
will be nested within the environment's outputManager
object.
var outputSream = enviro.audioStrategy.outputManager.outputStream;
I'm curious, what are you doing with Flocking where you need to access its underlying output stream? I've always considered it an internal implementation detail, but always try to make these sorts of things available in case people do need them. What's your use case?
I'm looking forward to seeing (hearing?) what you do with it!
Wow, @colinbdclark, awesome support! It works now.
My intentions was to stream output from Flocking over UDP sockets. Kinda got this working for now, but still needs more work on delay compensations.
Sounds awesome! I'd love to see what you're working on once you get it working. I've thought of doing something like this with Flocking for a while, and it's exciting to hear that you're making progress on it.
Since it sounds like this resolved your issue, I'll go ahead and close it here.
This API will change in Flocking 0.2.0 (which hasn't yet been released) due to factoring improvements I've been making. The outputStream will be nested within the environment's outputManager object.
var outputSream = enviro.audioStrategy.outputManager.outputStream;
It not possible to gather outputStream this way. Can you please update this how it actually works in 0.2.0?
Hi @markoarnauto,
Just in case, I should be clear: this is an unsupported API, and Flocking 0.2.0 hasn't yet (still!) been released officially. But if you're using the 0.2.0-dev.20170206T221943Z.fb09a52
dev release or the latest code in master, and want to access the underlying audio output stream being piped to node-speaker, the audioStrategy
component has been renamed to audioSystem
.
var flock = require("flocking");
var enviro = flock.init();
var outputStream = enviro.audioSystem.outputManager.outputStream;
I hope this helps!
How can I get an output stream?
When using
flock.nodejs.outputManager.createOutputStream
I get: