Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-channel mix ends up distorted/staticky #17

Open
c0bra opened this issue Nov 7, 2024 · 5 comments
Open

Multi-channel mix ends up distorted/staticky #17

c0bra opened this issue Nov 7, 2024 · 5 comments
Labels
question Further information is requested

Comments

@c0bra
Copy link

c0bra commented Nov 7, 2024

I am trying to merge real time system audio with mic audio in an Electron.

All audio sounds fine when there's one input, but with two it gets distorted and staticky. I've checked all the bit depths and sample rates and they should all be matching.

If I try to change the mixer to two channel the pitch lowers and playback rate seems slower so I'm not sure multi-channel is working as expected.

Any ideas?

@AlexPl3331
Copy link
Owner

Hello, could you please provide me with:

  1. Version of node.js
  2. Version of Electron
  3. Example code that repeats your problem

@AlexPl3331 AlexPl3331 added the question Further information is requested label Nov 8, 2024
@c0bra
Copy link
Author

c0bra commented Nov 8, 2024

Hello, could you please provide me with:

  1. Version of node.js
  2. Version of Electron
  3. Example code that repeats your problem

I will try. Will have to redo my streaming setup to make it stand-alone. Hopefully by Monday.

@c0bra
Copy link
Author

c0bra commented Nov 8, 2024

@AlexPl3331 OK got it: https://github.com/c0bra/node-audio-mixer-example

I can do a more robust example given more time. In my other code when I go down to a single input the resulting audio is fine but I'm not able to recreate that with this streaming method atm.

@AlexPl3331
Copy link
Owner

@AlexPl3331 OK got it: https://github.com/c0bra/node-audio-mixer-example

Thanks for the example, I looked at it. Sorry, but the audio mixer doesn't support float32. About "if I plan to add support for float32"? I think I will try.

@c0bra
Copy link
Author

c0bra commented Nov 8, 2024

Ah interesting. I didn't have luck capturing Int16 frames on a mac with ScreenCaptureKit. Perhaps I can do some on the fly processing to convert. I've done that elsewhere:

const int16array = Int16Array.from(interleaved.map(x => (x > 0 ? x * 0x7FFF : x * 0x8000)));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants