Author Topic: Can we redirect speaker output as encoder input?  (Read 62 times)

scarboni

  • Posts: 35
Hello !
I would like to allow to capture the output of a software, or speakers, into mine, to stream it to a distant server as I would do with a classic input (microphone or anything) that I would capture.

Is it possible to achieve so using bass? I did not find anything about it, but I may have mis-searched 

Thank you !

Ian @ un4seen

  • Administrator
  • Posts: 23404
Re: Can we redirect speaker output as encoder input?
« Reply #1 on: 18 Feb '21 - 16:00 »
If you're using Windows, there are "loopback" recording devices that can capture the output. They can be identified in BASS's recording device list by the BASS_DEVICE_LOOPBACK flag being set. The corresponding output device can be identified (in the output device list) by it having the same "driver" value as the loopback device.

I don't think the other platforms have such an option built-in, but you may be able to use a virtual device driver to capture the sound. For example, there's Soundflower on macOS.

scarboni

  • Posts: 35
Re: Can we redirect speaker output as encoder input?
« Reply #2 on: 19 Feb '21 - 09:08 »
Thank you !

For mac, I didn't try soundflower yet, but for Windows, I didn't find any device with the loopback flags, even though I was playing sound on another app. Is there something I must do to activate it? I also stumbled upon wasapi, but, didn't really understand what it was, I know there is a wasapi bass add on, but i'm not sure wasapi is linked to my issue. :/

Ian @ un4seen

  • Administrator
  • Posts: 23404
Re: Can we redirect speaker output as encoder input?
« Reply #3 on: 19 Feb '21 - 15:36 »
Loopback recording is enabled by default in BASS, so you don't need to do anything to activate it. Are you using BASS_RecordGetDeviceInfo to check the recording device list, not BASS_GetDeviceInfo for the playback device list? If the problem persists, you could try running the pre-compiled DEVLIST.EXE example included in the BASS package (C\BIN folder) to check what it detects. If it's different to what you see in your app, you could then check the DEVLIST.C source file to see what it's doing different.