MultiMedia Soft forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

SMF - Just Installed!

Author Topic: AudioDJStudio output device array  (Read 2706 times)

Johnny J.

  • Newbie
  • *
  • Posts: 19
    • View Profile
AudioDJStudio output device array
« on: July 13, 2015, 03:48:00 PM »

Just wondering: How is the AudioDJStudio handling it if a sound card is connected to the computer while the application using the component is running (e.g. via USB)? Will the output device array change to reflect the new number of output devices? Will an event be raised? Do you risk the chance of the currently selected device suddenly changing index?

Or is nothing done before you restart the application?

If the latter is the case, is there any possibility of updating the output device array at runtime?

Cheers,
Johnny J.
Logged

Administrator

  • Administrator
  • Sr. Member
  • *****
  • Posts: 298
    • View Profile
    • MultiMedia Soft
Re: AudioDJStudio output device array
« Reply #1 on: July 13, 2015, 04:13:44 PM »

Hello,

when one of our audio components is instanced at runtime, the multimedia engine is started and initialized, input and output devices are enumerated: no further enumeration is performed automatically after this point; this means that after something changes inside audio devices configuration, the multimedia engine will not take any automatic action so it will continue working as nothing happened: in case you should remove one of the audio devices in use for playback, you will obviously observe that no sound is heard.

The only way to perform a new enumeration of devices at runtime, without the need to close the application, is to restart the multimedia engine and this can be performed in 2 ways:

  1- By destroying ALL of the instances of audio components currently instanced inside the process: if you have audio components inside the same form and no other instance is running in background somewhere else, this will be done by closing and reopening the form

  2- By calling the ResetEngine method: this reset will affect both components, the player and the recorder, so both of them will have to be initialized again through the respective ResetControl methods; the sequence to perform would be the following:
   - AudioDjStudio.ResetEngine
   - AudioDjStudio.ResetControl (....)
   - AudioSoundRecorder.ResetControl (....)
   - AudioSoundEditor.ResetControl (....)

It must be finally remarked that detection of audio devices configuration changes varies depending upon the version of Windows:

- Windows XP: When a change occurs inside audio devices configuration (may be also a simple change of the system default audio device, not necessarily a device insertion/extraction) the DeviceChange event is raised: when this happens, should be up to the final user deciding the need of a reset: due to the fact that a USB device will not insert itself without the human intervention, the final user could be prompted if he wants to perform a reset of the audio components.

- Windows Vista and higher: depending upon the type of change inside audio devices configuration, a set of specific events is provided: CoreAudioDeviceDefaultChange, CoreAudioDeviceAdded, CoreAudioDeviceRemoved and CoreAudioDeviceStateChange

Hope this will bring some light  :)

Kind regards

Severino Delaurenti
MultiMedia Soft
Logged

Johnny J.

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: AudioDJStudio output device array
« Reply #2 on: July 13, 2015, 04:38:40 PM »

Thanks Severino! Perfect reply!  :D
Logged