# SpeechToTextLoader

> **Class** in `langchain_google_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-google-community/google_speech_to_text/SpeechToTextLoader)

Loader for Google Cloud Speech-to-Text audio transcripts.

Inherits from [`BaseLoader`][langchain_core.document_loaders.BaseLoader].

Transcribes audio files using Google Cloud Speech-to-Text API and loads
transcribed text into documents. Supports both GCS URIs and local file paths.

See [Speech-to-Text documentation](https://cloud.google.com/speech-to-text)
for detailed information.

!!! note "Installation"

    Requires additional dependencies:

    ```bash
    pip install langchain-google-community[speech]
    ```

## Signature

```python
SpeechToTextLoader(
    self,
    project_id: str,
    file_path: str,
    location: str = 'us-central1',
    recognizer_id: str = '_',
    config: Optional[RecognitionConfig] = None,
    config_mask: Optional[FieldMask] = None,
    is_long: bool = False,
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_id` | `str` | Yes | Google Cloud Project ID. |
| `file_path` | `str` | Yes | Google Cloud Storage URI or local file path. |
| `location` | `str` | No | Speech-to-Text recognizer location. (default: `'us-central1'`) |
| `recognizer_id` | `str` | No | Speech-to-Text recognizer ID. (default: `'_'`) |
| `config` | `Optional[RecognitionConfig]` | No | Recognition options and features. See [`RecognitionConfig`](https://cloud.google.com/python/docs/reference/speech/latest/google.cloud.speech_v2.types.RecognitionConfig). (default: `None`) |
| `config_mask` | `Optional[FieldMask]` | No | Fields in config that override `default_recognition_config` of the recognizer. See [`RecognizeRequest`](https://cloud.google.com/python/docs/reference/speech/latest/google.cloud.speech_v2.types.RecognizeRequest). (default: `None`) |
| `is_long` | `bool` | No | Use async Cloud Speech recognition for long audio files. See [batch recognize](https://cloud.google.com/speech-to-text/v2/docs/batch-recognize). (default: `False`) |

## Extends

- `BaseLoader`

## Constructors

```python
__init__(
    self,
    project_id: str,
    file_path: str,
    location: str = 'us-central1',
    recognizer_id: str = '_',
    config: Optional[RecognitionConfig] = None,
    config_mask: Optional[FieldMask] = None,
    is_long: bool = False,
)
```

| Name | Type |
|------|------|
| `project_id` | `str` |
| `file_path` | `str` |
| `location` | `str` |
| `recognizer_id` | `str` |
| `config` | `Optional[RecognitionConfig]` |
| `config_mask` | `Optional[FieldMask]` |
| `is_long` | `bool` |


## Properties

- `project_id`
- `file_path`
- `location`
- `recognizer_id`
- `config`
- `config_mask`

## Methods

- [`load()`](https://reference.langchain.com/python/langchain-google-community/google_speech_to_text/SpeechToTextLoader/load)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-google/blob/a3f016b2a6c4af535df275545f76fa7424aa39e5/libs/community/langchain_google_community/google_speech_to_text.py#L15)