Comments (1)
Not in the provided API. The input stream is also a bit tricky abstraction for it. Mumble doesn't handle positional audio as some hypothetical multichannel audio; instead the audio is still encoded as mono/stereo stream. The positional information is then added as extra metadata on the audio packets.
The input stream eats PCM audio, splits this in audio frames and encodes it. These encoded frames are then combined into a Mumble audio packet based on packet size settings. That audio packet has optional field for the positional data.
The issue here is that the input stream doesn't expose details/API on packet boundaries so there is no way to tell when the packet changes and positional data could be sent. Associating positional data with each sample would be quite expensive.
On the MumbleConnection-level the packets are formed in the sendEncodedFrame
function:
node-mumble/lib/MumbleConnection.js
Lines 386 to 396 in 3387e12
The protocol docs indicate the positional data should follow the frames: https://mumble-protocol.readthedocs.io/en/latest/voice_data.html#encoded-audio-data-packet
Writing three float coordinates after the frames on line 396 would take care of that (and ensuring the length info on line 390 takes that added data into account).
A possible API for this would have current position as a state on the stream the user would keep up to date. Then when the stream queues the frames on the connection by invoking connection,sendVoiceFrame
it would also pass the position data as a parameter. sendVoiceFrame
would then pass the parameter to sendEncodedFrame
. This would avoid the stream from having to expose the packet boundaries or from the user having to pass the location data with every sample.
Alternative to exposing the location as a field on the stream object would be to support some in-stream metadata that could be written to the stream through normal write APIs and the stream would update its internal state based on those - writing the location data would then proceed as above. I don't see much point with this though.
Now unfortunately this project is not only not maintained anymore, but I also lost the use of my other hand few months ago so I'm not going to be able to do any maintenance currently. The above instructions should enable you to make the necessary changes if you need them.
from node-mumble.
Related Issues (20)
- Trouble authenticating user HOT 2
- Events in the client HOT 7
- Register user HOT 9
- Deaf state not updated on user
- user.inputStream() fails with TypeError: cannot set whisperId of undefined HOT 2
- Not receiving private message event? HOT 4
- Is this project dead? HOT 3
- Update dependencies HOT 3
- BIZZARE WEIRD ERRORS UPON INSTALLATION HOT 4
- Play audio from channel (server) HOT 4
- Not recording from subgroup. HOT 1
- npm install not working anymore HOT 3
- Install error 886 verbose stack Error: [email protected] install: `node-gyp rebuild` HOT 2
- v8 warning for native addon on node v6+ HOT 4
- How do I set the comment for the connected user? HOT 5
- Fatal error in api.cc HOT 6
- Can't run sendMessage function from outside mumble.connect HOT 2
- Windows 10 disconnects after a few seconds HOT 1
- Is there an example how to play/stream audio to Web Audio API ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-mumble.