Asked
— Edited
Hi all,
Has anyone been able to Stream audio triggered from other programs through ARC over wifi to an EZB? I know the PC soundboard will play sound files located on your laptop. But what I want to do is play audio on an EZB that would normally play through my PC's speaker. For example maybe an internet radio show, a youtube video audio track, sound files triggered and used by another program on the laptop other then ARC.
Thanks in advance.
Related Hardware EZ-B v4
Long answer:
When you capture sound or video, there is a delay until you fill a buffer, and then you start doing something at specific intervals.
Buffering introduces a delay between the real data (sound) and whatever you do next with the captured data (play on the EZB).
The capture process introduces a buffer of 5 seconds, this means when a capture action is received, 5 seconds are captured and only then are ready to be forward to a device, and then repeating a cycle of 5 seconds
It could be less time.
why is needed a buffer ? all the code running between capture, re-sampling, sending to EZB, takes cpu time.
When capturing sound the encoding will vary per device, generally the output device (Speakers) generates: Stereo, 48Khz, 32 Bits EZB accepts Mono, 14.7Khz, 8 Bits.
The re-sampling is also done by the capture action.
As an example:
1 second of sound captured represents: 48000 x 4 (32bits) x 2 (Stereo) = 384K
1 second of sound sent to EZB represents: 14700 x 1 (8bit) x 1 (Mono) = 14.7 K
Each capture action, is a different thread and is responsible for capturing, resample, record to file (if specified), and forward to all EZBs listening.
The Listen command adds an EZB to the capture thread, even if you add two EZBs at different intervals, both will be in sync.
The capture thread forwards the sound at specific intervals (5 seconds).
BUT if you do this:
EZB 1 will have a delay of a 1 second or more compared to EZB 0
If you want 1 or more EZBs synchronized you should add them to the same capture.
Sorry the "mambo jambo" stuff, but sometimes it's necessary to explain the implementation details.
It's working for me now. Thanks very much. It sounds great! It was just as simple as the extra space. Also thanks for the info on how to run the scripts.
As great as this works I was wondering if you had a couple ideas. You mentioned that the buffering delay could be shortened. How would I do that and how short could we go? Also is there any way to stop the speakers on the computer from playing when streaming to EZB when using this plugin? It would be nice to have the only sound coming from the EZB like hen you use the V4 Soundboard. ? Perhaps I could install another audio device? I did notice that if I raise or lower the volume or even mute it on the computer the EZB speaker will adjust at the same time.
If non of that is possible then as it is, this plugin you made is fabulous anyway.
@Dave,
I ll need to investigate.
i have some other projects on queue (Kinect is one of them), i ll come back to this as soon as possible.
but i'm always open to brainstorm ideas.
One question before you mention you capture sounds from an APP to stream to EZB, what kind of app is that ?
PTP, sorry if I wasn't clear. I don’t have an app installed yet that I could configure your plugin towards that I could use. I was just wondering if there was one out there that I could install on my computer that I could point the plugin towards that would allow me to turn off the speakers but still stream to ezb. All I have listed now for available devices to configure to is my laptops sound and speaker system. When I mentioned volume and mute I was talking about the laptops sound system.
Anyway, there's no big hurry. What you have done so far is amazing and much appreciated. Take care of your other projects. They sound awesome also. In the meantime I have lot of other things to do including play with this new plugin of yours.
There are (fairly inexpensive now) USB sound card devices. You could plug one in and jsut not connect speakers to it.
Here is an example: https://www.amazon.com/Sabrent-External-Adapter-Windows-AU-MMSA/dp/B00IRVQ0F8?ie=UTF8&ref_=zg_bs_3015427011_1
If the app you are using to play sounds doesn't allow selection of the sound device, the Windows 10 Mixer does allow you to specify which device is used for which applications.
It would probably be possible to create a "dummy" sound driver that did the same without hardware, but I doubt it exists today since the use cases are pretty small and there is no way you could get someone to write one for less than the hardware solution costs.
Alan
Thanks Alan! This was just what I was thinking and looking for. If I can install this usb sound card and map the plugin to it I may not need PTP to do any adjustments to his coding.
@Alan,
Good info,
the first time i played with windows sound api, i used DirectSound, the plugin has some direct sound api code, but, is not being used.
A funny fact, i'm using code from 1999, so still working today
With Direct Sound you need to rely on the hardware board to provide a Mix or loopback device.
If not available the solution would be to wire the speakers output to a line IN to capture sound.
but the game changed, when Vista was launched, a new API WASAPI the "Loopback" channel is done by the new API, so does not matter what kind of hardware driver.
I believe the wasapi loopback is like a Y cable, so you are dependent of the speakers volume, you don't have control over the output. I noticed that with the sound format, you can't instruct the API to capture the sound with a specific format.
Alan suggestion makes sense, although i think it's possible to create a software Endpoint, but it can't be hosted inside an ARC skill plugin.
@Dave, what kind of Windows you have ?