BB FlashBack SDK: Base Classes

Recording Sound Sources and Devices

A PC will typically have a sound 'device' for each sound card installed, and each device will have a number of sources available for recording, such as the microphone, PC sounds, line in and others.

FBRecorder allows you to set the sound device and source to record from, but uses a different set of methods and properties for Windows 2000/XP than for Vista.

For help on accessing individual sound tracks in a recording and saving them to files, see How the sound classes work.

 

Windows 2000/XP

Setting the Sound Device and Source in Windows 2000/XP

  1. Use SoundDevicesCount to get the number of attached recordable sound devices. This gives the range of valid device indexes.

  2. Pass a device index into GetSoundDevice, to get a device ID and name.

  3. Select a sound device for recording by setting SoundDevice to the ID of the required device.


    Once we've selected a sound device, we follow a similar process to select a sound source on that device.

  4. Call GetSoundSources to prepare the internal list of sound sources. This call has to be made before using SoundSourcesCount, GetSoundSource and GetSoundSourcesInfo.

  5. Use SoundSourcesCount to get the number of sources available on the selected device. This gives the range of valid source indexes.

  6. Set SoundSource to the index of the source to be recorded.


     

Altering source volume or muting sources in Windows 2000/XP

The GetSoundLineVolume and SetSoundLineVolume methods can be used to retrieve and set the recording volume for a particular source on the current device.

The GetSoundLineMuteValue and SetSoundLineMuteValue can be used to mute a source.

The input to these functions is a LineID, returned from GetSoundSource when the source index is passed in.

 

Getting the index of the Microphone and "PC sounds" sources

To get the index of the current source, microphone and "mix" source (typically the sounds heard in the PC speakers), use GetSoundSourcesInfo.

 

 

 

Windows Vista and 7

 

Retrieving the ID and other information for each sound source

Use VistaSoundSourcesCount to get the number of sound devices and sources available for recording. It returns the total number of sources available for recording across all attached devices. The gives a range of valid indexes that can be passed to GetVistaSoundSource.

Pass an index into GetVistaSoundSource to retrieve information, including the ID, for a device-source combination.

 

To identify microphone sources:

 

To identify the "PC Sounds" source (the sound you hear through the PC speakers)

 

To record a microphone source in Vista:

 

To record the "PC Sounds" source in Vista:

 

To record a sound source other than "PC Sounds" or a microphone in Vista:

 

To record PC Sounds and microphone in Vista

Vista has extra sound functionality that enables recording of the microphone and "PC Sounds" source simultaneously, into different tracks.

 

Altering source volume or muting sources in Windows Vista

Use GetVistaSoundVolumeValue and SetVistaSoundVolumeValue to alter the volume of sound recording sources. These methods require source IDs. Call GetVistaSoundSource to obtain the source IDs, or get the ID of the microphone source from VistaMicrophoneID.