---
name: "CL_Sound"
section: "3"
platform: "linux"
package: "clanlib0-common-dev"
version: "0.4.4-8"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/CL_Sound"
---

# CL\_Sound(3)

Sound interface in ClanLib.

## NAME

CL\_Sound - Sound interface in ClanLib.

## DESCRIPTION

This class provides a list of all soundcards available on the system. It is also a wrapper class for the CL\_SoundCard class, providing an easier access to a single selected soundcard.

All the functions that share name with those in CL\_SoundCard have the same functionality. The only difference is, that the ones CL\_Sound operate on a selected soundcard. This saves the trouble of passing around a pointer to the soundcard, when only a single one is used anyway.

## CLASS MEMBERS

- virtual **~CL\_Sound**()

  - static std::vector\<CL\_SoundCard\*\> **cards**

  - static std::list\<CL\_SoundCard\*\> **preload\_cards**

  - static CL\_StreamSoundProvider \***get\_microphone**()

  - static CL\_StreamSoundProvider \***get\_line\_in**()

  - static void **clear\_card\_preload**()

  - static void **add\_card\_preload**(

  ```
  CL_SoundCard *card)
  ```

- static void **remove\_card\_preload**(

  ```
  CL_SoundCard *card)
  ```

- static void **select\_card**(

  ```
  CL_SoundCard *card)
  ```

- static void **select\_card**(

  ```
  int card_no)
  ```

- static CL\_SoundCard \***get\_current\_card**()

  ## MEMBERS WITH DESCRIPTIONS

- virtual **~CL\_Sound**()

  ```
  Description:
  ```

- static std::vector\<CL\_SoundCard\*\> **cards**

  ```
  Description:
  ```

  The list of soundcards available on this system.

- static std::list\<CL\_SoundCard\*\> **preload\_cards**

  ```
  Description:
  ```

  List of all cards where soundbuffers are automatically preloaded.

- static CL\_StreamSoundProvider \***get\_microphone**()

  ```
  Description:
  ```

  Returns the streamed soundprovider representing the microphone.

  ```
  Return value:
  ```

  The microphone.

- static CL\_StreamSoundProvider \***get\_line\_in**()

  ```
  Description:
  ```

  Returns the streamed soundprovider representing the line in.

  ```
  Return value:
  ```

  The line in.

- static void **clear\_card\_preload**()

  ```
  Description:
  ```

  Clears the list of preloaded soundcards.

- static void **add\_card\_preload**(

  ```
  CL_SoundCard *card)
  ```

  ```
  Parameters:
  card - The card to be added to the preload list.
  ```

  ```
  Description:
  ```

  Adds *card* to the preloaded soundcards list. This means all soundbuffers will be automatically preloaded onto the card. By default the first card is always on the preload list.If a card isn*t on the list, the soundbuffer*s data will first be loaded when the sample is actually played for the first time.

- static void **remove\_card\_preload**(

  ```
  CL_SoundCard *card)
  ```

  ```
  Parameters:
  card - The card to be removed from the list.
  ```

  ```
  Description:
  ```

  Removes the specified card from the preload list.

- static void **select\_card**(

  ```
  CL_SoundCard *card)
  ```

  ```
  Parameters:
  card - The new current selected soundcard.
  ```

  ```
  Description:
  ```

  Change the current selected soundcard to *card*.

- static void **select\_card**(

  ```
  int card_no)
  ```

  ```
  Parameters:
  card_no - Card number in the CL_Sound::cards list.
  ```

  ```
  Description:
  ```

  Change the current selected soundcard to soundcard number *card\_no*.

- static CL\_SoundCard \***get\_current\_card**()

  ```
  Description:
  ```

  Returns the current selected soundcard.

  ```
  Return value:
  ```

  Current soundcard.

## SEE ALSO

- **CL\_SoundCard**

  Soundcard interface class.

- **CL\_SoundBuffer**

  Sample class in ClanLib.

All ClanLib API classes can be found in **clanlib (3)**.

## AUTHORS

Originally written by Magnus Norddahl \<*mbn@dark.x.dtu.dk*\> and Martin Starch \<*starch@dark.x.dtu.dk*\>. ClanLib is now developed by the ClanLib Development team as an Open Source project.

The ClanLib man pages was created using the Perceps documentation system (another excellent piece of Open Source software, available at **http://somewhere.in.the.world.org**).

See **clanlib (3)** to find out how to get a full list of contributors and details on how to submit bug reports, comments etc.
