> ## Documentation Index
> Fetch the complete documentation index at: https://docs.daytalog.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sound

> A collection of sound related properties and methods

[Back to Log](/schemas/daytalog/log)

## Usage

```javascript theme={null}
const { log } = useDaytalog();
// Get the total size of sound files
const size = log.sound.size();
```

## Properties

### <span className="visually-hidden">clips</span>

<ResponseField name="clips" type="SoundClipType[]">
  Sound Clips (Audio files associated with the log)
</ResponseField>

### <span className="visually-hidden">files()</span>

<ResponseField name="files()" type="number">
  Retrieves the total number of files.

  <Expandable title="Example">
    ```javascript theme={null}
    const totalFiles = log.sound.files();
    console.log(totalFiles); // Output: 5
    ```
  </Expandable>
</ResponseField>

### <span className="visually-hidden">size()</span>

<ResponseField name="size()" type="string">
  Gets the size in a user-friendly format, such as "1.17 GB" or "117 MB".

  <br />

  You can specify the unit of measurement you prefer by providing an options object. The default unit is <code>"auto"</code>.

  <br />

  Options: <code>size({'{'} type: "auto" | "tb" | "gb" | "mb" | "bytes" {'}'})</code>

  <Expandable title="Example">
    ```javascript theme={null}
    // Automatically choose the best unit
    const sizeAuto = log.sound.size();
    console.log(sizeAuto); // Output: "117 MB"
    // Specify the unit as Gigabytes
    const sizeGB = log.sound.size({ type: 'gb' });
    console.log(sizeGB); // Output: "0.117 GB"
    ```
  </Expandable>
</ResponseField>

### <span className="visually-hidden">sizeAsNumber()</span>

<ResponseField name="sizeAsNumber()" type="number">
  Retrieves the size as a numerical value.

  <br />

  This method returns the size in a numerical format, which can be useful for calculations or comparisons.
  You can specify the unit of measurement by providing an options object. The default unit is <code>"bytes"</code>.

  <br />

  Options: <code>sizeAsNumber({'{'} type: "auto" | "tb" | "gb" | "mb" | "bytes" {'}'})</code>

  <Expandable title="Example">
    ```javascript theme={null}
    // Get size in the default unit (bytes)
    const sizeNumberDefault = log.sound.sizeAsNumber();
    console.log(sizeNumberDefault); // Output: 117000000
    // Get size in Gigabytes
    const sizeNumberGB = log.sound.sizeAsNumber({ type: 'gb' });
    console.log(sizeNumberGB); // Output: 0.117
    // Get size in Megabytes
    const sizeNumberMB = log.sound.sizeAsNumber({ type: 'mb' });
    console.log(sizeNumberMB); // Output: 117
    ```
  </Expandable>
</ResponseField>

### <span className="visually-hidden">sizeAsTuple()</span>

<ResponseField name="sizeAsTuple()" type="[number, string]">
  Obtains the size as a pair containing both the numerical value and its unit.

  <br />

  This method returns an array where the first element is the size number and the second element is the unit.
  You can specify the unit of measurement by providing an options object. The default unit is <code>"auto"</code>.

  <br />

  Options: <code>sizeAsTuple({'{'} type: "auto" | "tb" | "gb" | "mb" | "bytes" {'}'})</code>

  <Expandable title="Example">
    ```javascript theme={null}
    // Get size as a tuple with automatic unit
    const sizeTupleAuto = log.sound.sizeAsTuple();
    console.log(sizeTupleAuto); // Output: [117, 'MB']
    // Get size as a tuple in Gigabytes
    const sizeTupleGB = log.sound.sizeAsTuple({ type: 'gb' });
    console.log(sizeTupleGB); // Output: [0.117, 'GB']
    ```
  </Expandable>
</ResponseField>

### <span className="visually-hidden">copies()</span>

<ResponseField name="copies()" type="{ volumes: string[]; clips: string[]; count: [number, number] }[]">
  Retrieves the copies as an array of objects.

  <Expandable title="Properties">
    <ResponseField name="volumes" type="string[]">
      The volumes for the copy. A copy can be split on multiple volumes.
    </ResponseField>

    <ResponseField name="clips" type="string[]">
      The clips in this copy
    </ResponseField>

    <ResponseField name="count" type="[number, number]">
      First number represents the number of clips in this copy.
      Second number is total number of clips.
      The copy has all clips if both numbers are equal. Else it is not complete.
    </ResponseField>
  </Expandable>

  <Expandable title="Example">
    ```javascript theme={null}
    const copies = log.sound.copies();
    console.log(copies); // Output: [{ volumes: ['Volume1'], clips: ['SC01T01'], count: [10, 10] }, ...]
    ```
  </Expandable>
</ResponseField>
