# Raw Audio Format

A raw audio file is any file containing un-containerized and uncompressed audio. The data is stored as raw pulse-code modulation (PCM) values without any metadata header information (such as sampling rate, bit depth, endian, or number of channels)

### Extensions

Raw files can have a wide range of file extensions, common ones being `.raw`, `.pcm`, or `.sam`. They can also have no extension.<br>

***

## Transcribing Raw Audio Format

If you want to transcribe raw audio format, you need to send the request with the following parameters. These parameters ensure that the audio is processed correctly by the Gowajee STT API.

### Required Parameters

1. **sampleRate (Integer)**: The sample rate represents the number of samples of audio carried per second, measured in Hertz (Hz). It defines how many data points of audio are sampled in one second.
   * **Example**: 16000, 44100
2. **sampleWidth (Integer)**: The sample width, also known as bit depth, determines the number of bits used to represent each audio sample. It directly affects the dynamic range of the audio signal.
   * **Example**: 1 (8-bit), 2 (16-bit)
3. **channels (Integer)**: Channels refer to the number of independent audio signals or paths in an audio file. Common values are mono (1 channel) and stereo (2 channels).
   * **Example**: 1 (mono), 2 (stereo)

### Example Request

```http
POST /v1/speech-to-text/${MODEL}/transcribe HTTP/1.1
Host: api.gowajee.ai
Content-Type: application/json
X-Api-Key: ${YOUR_API_KEY}

{
  "audioData": "base64_encoded_raw_audio_data",
  "sampleRate": 16000,
  "sampleWidth": 2,
  "channels": 1
}

```

### Example Response

```json
{
  "type": "ASR_PULSE",
  "amount": 4.517,
  "output": {
    "results": [
      {
        "transcript": "วันนี้กินอะไรดี",
        "startTime": 0,
        "endTime": 4.517
      }
    ],
    "duration": 4.517,
    "version": "2.2.0"
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.gowajee.ai/speech-to-text/raw-audio-format.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
