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

# Get emotions (Discrete)

> For real-time emotion classification of short files, the file's singular classified emotion is returned, along with confidences of other emotions in the model.

### Parameters

* `file_path` (string): Path to the audio file

### Response

**Returns:** `prediction [string]` - Emotion prediction results

**Throws:** Error if file doesn't exist, API key missing, or request fails

<Info>
  API Keys are included in the client constructor. Find more information on the client constructor [***here.***](/api-reference/introduction)
</Info>

### Usage

<CodeGroup>
  ```python Python theme={null}
  from valenceai import ValenceClient

  client = ValenceClient()
  result = client.discrete.emotions("YOUR_FILE.wav")
  print(result)
  ```

  ```javascript JavaScript theme={null}
  import { ValenceClient } from 'valenceai';

  try {
    const client = new ValenceClient();
    const result = await client.discrete.emotions('YOUR_FILE.wav');
    console.log('Emotion detected:', result);
  } 
  catch (error) {
    console.error('Error:', error.message);
  }
  ```
</CodeGroup>
