# Sample Resources

### Resource options

Each sample can have the following properties:

    <sample
    	name="my_sample"
    	file="filename"
    	format="sound_format"
    	stream="[no,yes]" >

To setup a sample resource, it is required to specify the name and file attributes of <sample>. If ClanLib has trouble determining what format the specified filename is in, the extension known by clanlib (eg. "wav") can be told using the format attribute.

Per default a sample is loaded in its entirely into memory. If the stream attribute is set to "yes", it will instead stream the sample from disk during playback. For very long samples (eg. music in a level), this can save considerable memory.

### Sample resource options reference

<sample>

- Attribute name: Name of resource.

  Valid values:
  Default value: None, MUST BE PRESENT.

- Attribute file: Filename of sample to be used.

  Valid values:
  Default value: None, MUST BE PRESENT.

- Attribute format: Extension of known format to be used for loading.

  Valid values: "wav", "ogg", "it", "xm", "s3m", "mtm", "669", "stm", "ult", "far", "med", "amf", "dsm", "imf", "gdm", "stx", "okt" and "mod"
  Default value: Uses the extension used in the file attribute.

- Attribute stream: Stream from file flag.

  Valid values: "no", "yes"
  Default value: "no"