send an input audio stream to a streaming server?

Started by Terry, November 05, 2024, 05:51:24 AM

Previous topic - Next topic

Terry

Hi,

Is there any way to send an input audio device stream to a streaming server?

Terry
Thank you.

Administrator

Hello Terry,

yes, this is possible with our DJ Studio components: take a look into the WasapiMixAndClone sample project, installed by our setup program, which shows how to attach an input device to the internal stream mixer and to send the result to a streaming server.

Hope this helps.

Kind regards

Severino Delaurenti
MultiMedia Soft

Terry

Hi,

There are two ways to send an audio stream to a streaming server. The sample project is one of them.
But it still needs to be attached to a Player and then output.
Is there any way to capture only the input audio source but not play output?

There is one more thing that I am confused about the WasapiMixAndClone sample project.
Why a control can initial more than 4 players? The three extra Players in the sample program seem to have no effect.

// init the DJ Studio control by instancing an adequate number of players:
// 2 for playing sound files from disk and 5 for attaching input devices
short nPlayers = 2 + 5;
nPlayers = m_audioDjAPI.InitSoundSystem(nPlayers, m_nWasapiDevice, m_nWasapiDevice, m_nWasapiDevice, 0);

Terry
Thank you

Administrator

Hello

Quote from: Terry on November 07, 2024, 06:35:13 AMThere are two ways to send an audio stream to a streaming server. The sample project is one of them.
But it still needs to be attached to a Player and then output.
Is there any way to capture only the input audio source but not play output?

Yes, you can avoid any sound being sent to the render device by setting its output device to -1; inside the FormMain_Load function you will find the following lines of code

// obtain the stream mixer internal to the selected WASAPI device
m_nStreamMixerUniqueID = m_audioDjAPI.StreamMixerGetIdFromOutput (m_nWasapiDevice);

simply add the following code immediately after them:

m_audioDjAPI.StreamOutputDeviceSet(m_nStreamMixerUniqueID, -1);

QuoteThere is one more thing that I am confused about the WasapiMixAndClone sample project.
Why a control can initial more than 4 players? The three extra Players in the sample program seem to have no effect.

// init the DJ Studio control by instancing an adequate number of players:
// 2 for playing sound files from disk and 5 for attaching input devices
short nPlayers = 2 + 5;
nPlayers = m_audioDjAPI.InitSoundSystem(nPlayers, m_nWasapiDevice, m_nWasapiDevice, m_nWasapiDevice, 0);

Inside the project there are 2 players that are used for loading and playing sound files from disk (Player_1 and Player_2) while the other 5 players (Player_Input_3 up to Player_Input_7) are used to attach different input channels and mix them into the internal stream mixer of the render device.
If you shouldn't need to play sounds from files on disk and you should simply need to attach and cast one single input stream you may instance one single player only.

Hope this helps

Kind regards

Severino Delaurenti
MultiMedia Soft