.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_SampleLibrary: SampleLibrary ============= **Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` **Category:** Core Brief Description ----------------- Library that contains a collection of samples. Member Functions ---------------- +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_sample` **(** :ref:`String` name, :ref:`Sample` sample **)** | +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Sample` | :ref:`get_sample` **(** :ref:`String` name **)** const | +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array` | :ref:`get_sample_list` **(** **)** const | +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_sample` **(** :ref:`String` name **)** const | +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`remove_sample` **(** :ref:`String` name **)** | +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`sample_get_pitch_scale` **(** :ref:`String` name **)** const | +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`sample_get_priority` **(** :ref:`String` name **)** const | +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`sample_get_volume_db` **(** :ref:`String` name **)** const | +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`sample_set_pitch_scale` **(** :ref:`String` name, :ref:`float` pitch **)** | +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`sample_set_priority` **(** :ref:`String` name, :ref:`int` priority **)** | +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`sample_set_volume_db` **(** :ref:`String` name, :ref:`float` db **)** | +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ Description ----------- Library that contains a collection of :ref:`Sample`, each identified by a text ID. This is used as a data container for the majority of the SamplePlayer classes and derivatives. Sample players will never yield an active (currently playing) voice for a new playback request when there are no inactive voices available if the priority of the sample requested to be played is lower than that of every currently played samples. Member Function Description --------------------------- .. _class_SampleLibrary_add_sample: - void **add_sample** **(** :ref:`String` name, :ref:`Sample` sample **)** Add a sample to the library, with a given text ID. .. _class_SampleLibrary_get_sample: - :ref:`Sample` **get_sample** **(** :ref:`String` name **)** const Return the sample from the library matching the given text ID. Return null if the sample is not found. .. _class_SampleLibrary_get_sample_list: - :ref:`Array` **get_sample_list** **(** **)** const .. _class_SampleLibrary_has_sample: - :ref:`bool` **has_sample** **(** :ref:`String` name **)** const Return true if the sample text ID exists in the library. .. _class_SampleLibrary_remove_sample: - void **remove_sample** **(** :ref:`String` name **)** Remove the sample matching the given text ID. .. _class_SampleLibrary_sample_get_pitch_scale: - :ref:`float` **sample_get_pitch_scale** **(** :ref:`String` name **)** const Return the pitch scale for the given sample. .. _class_SampleLibrary_sample_get_priority: - :ref:`int` **sample_get_priority** **(** :ref:`String` name **)** const Return the priority for the given sample. .. _class_SampleLibrary_sample_get_volume_db: - :ref:`float` **sample_get_volume_db** **(** :ref:`String` name **)** const Return the volume (in dB) for the given sample. .. _class_SampleLibrary_sample_set_pitch_scale: - void **sample_set_pitch_scale** **(** :ref:`String` name, :ref:`float` pitch **)** Set the pitch scale for the given sample. .. _class_SampleLibrary_sample_set_priority: - void **sample_set_priority** **(** :ref:`String` name, :ref:`int` priority **)** Set the priority for the given sample. .. _class_SampleLibrary_sample_set_volume_db: - void **sample_set_volume_db** **(** :ref:`String` name, :ref:`float` db **)** Set the volume (in dB) for the given sample.