---
name: "CL_Sample"
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_Sample"
---

# CL\_Sample(3)

ClanLib's datafile samples. This class can read samples from datafiles.

## NAME

CL\_Sample - ClanLib's datafile samples. This class can read samples from datafiles.

## CLASS MEMBERS

- static CL\_SoundBuffer \***create**(

  ```
   const char *sample_id,
  CL_InputSourceProvider *provider)
  ```

- **CL\_Sample**(

  ```
   const char *s_id,
  CL_InputSourceProvider *_provider)
  ```

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

  - virtual void **lock**()

  - virtual void **unlock**()

  - virtual SoundFormat **get\_format**()

  - virtual int **data\_size**()

  - virtual void \***get\_data**()

  - virtual int **get\_frequency**()

  ## MEMBERS WITH DESCRIPTIONS

- static CL\_SoundBuffer \***create**(

  ```
   const char *sample_id,
  CL_InputSourceProvider *provider)
  ```

  ```
  Description:
  ```

  Loads the sample *sample\_id* from the inputsource provider *provider*. Creates a CL\_SoundBuffer using this sample and returns it.

- **CL\_Sample**(

  ```
   const char *s_id,
  CL_InputSourceProvider *_provider)
  ```

  ```
  Description:
  ```

  Constructs a static sound provider that represents *sample\_id* from theinputsource provider *provider*.

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

  ```
  Description:
  ```

- virtual void **lock**()

  ```
  Description:
  ```

  Locks the sample data.

- virtual void **unlock**()

  ```
  Description:
  ```

  Unlocks the sample data.

- virtual SoundFormat **get\_format**()

  ```
  Description:
  ```

  Returns the sample format used by this sample.

- virtual int **data\_size**()

  ```
  Description:
  ```

  Returns the size of the sample.

- virtual void \***get\_data**()

  ```
  Description:
  ```

  Returns the sample data. Must be locked before this is done.

- virtual int **get\_frequency**()

  ```
  Description:
  ```

  Returns the default frequency used when playing this sample.

## SEE ALSO

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.
