{"id":20268683,"url":"https://github.com/agoraio/agora-rtt-server","last_synced_at":"2025-04-11T03:41:04.169Z","repository":{"id":149577570,"uuid":"621653705","full_name":"AgoraIO/agora-rtt-server","owner":"AgoraIO","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-01T03:37:06.000Z","size":63,"stargazers_count":6,"open_issues_count":1,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-25T01:41:29.294Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AgoraIO.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-31T05:29:12.000Z","updated_at":"2024-12-14T04:51:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"e1b6d0df-8323-4576-8bf6-b71d9adba1c3","html_url":"https://github.com/AgoraIO/agora-rtt-server","commit_stats":null,"previous_names":["agoraio/agora-rtt-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgoraIO%2Fagora-rtt-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgoraIO%2Fagora-rtt-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgoraIO%2Fagora-rtt-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgoraIO%2Fagora-rtt-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AgoraIO","download_url":"https://codeload.github.com/AgoraIO/agora-rtt-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248339270,"owners_count":21087213,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T12:19:21.629Z","updated_at":"2025-04-11T03:41:04.158Z","avatar_url":"https://github.com/AgoraIO.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿\n# Real-Time Transcription business server demo\n\nReal-Time Transcription (RTT) takes the audio content of a host's media stream and transcribes it into written words in real time. This Java project demonstrates how to set up a business server that your app uses to start and stop Real-Time Transcription tasks.\n\n## Understand the tech\n\nTo start transcribing the audio in a channel in real-time, you send an `HTTP` request to the Agora SD-RTN™ through your business server. Real-Time Transcription provides the following modes:\n\n* Transcribe speech in real-time, then stream this data to the channel.\n* Transcribe speech in real-time, store the text in the `WebVTT` format, and upload the file to third-party cloud storage.\n\nReal-Time Transcription transcribes at most three speakers in a channel. When there are more than three speakers, the top three are selected based on volume, and their audio is transcribed.\n\nThe following figure shows the workflow to start, query, and stop a Real-Time Transcription task:\n\n![Real-Time Transcription business server](https://docs-git-milestone37-speech-to-text-Agora-gdxe.vercel.app/en/assets/images/real-time-transcription-server-07d073102bebc8cf0f41e6985efc56b1.svg)\n\nTo use the RESTful API to transcribe speech, your server makes the following calls:\n\n1. `acquire`: Request a `builderToken` that authenticates the user and gives permission to start Real-Time Transcription . You must call `start` using this `builderToken` within five minutes.\n1. `start`: Begin the transcription task. Once you start a task, `builderToken` remains valid for the entire session. Use the same `builderToken` to query and stop the task.\n1. `query`: Check the task status.\n1. `stop`: Stop the transcription task.\n\n## Prerequisites\n\nIn order to deploy a demo Real-Time Transcription business server on [Railway](railway.app), you must have a [Railway](https://railway.app/) account verified through your github account.\n\nIf you want to build and run the server locally, you will need to have:\n\n* Java Development Kit (JDK) 1.8 or higher.\n* Installed [git](https://git-scm.com/downloads) on your development machine.\n* Installed [Maven](https://maven.apache.org/download.cgi) on your system.\n* An Integrated Development Environment (IDE) configured to work with Maven Java projects. \n* [Curl](https://curl.se/download.html) for testing your server implementation.\n* Enabled Real-Time Transcription for your project. Contact sales@Agora.io\n* Activated a [supported cloud storage service](#supported-third-party-cloud-storage-services) to record and store Real-Time Transcription texts.\n\n## Implement a business server\n\nYou create a business server as a bridge between your app and Agora Real-Time Transcription. Implementing this business \nserver provides the following benefits:\n\n* Improved security as your `apiKey`, `apiSecret`, `builderToken`, and `taskId`, are not exposed to the client.\n* Token processing is securely handled on the business server.\n* Avoid splicing complex request body strings on the client side to reduce the probability of errors.\n* Implement additional functionality on the business server. For example: \n   * Billing for  Real-Time Transcription \n   * Checking user privileges and the payment status of a user\n* If the REST API is updated, you do not need to update the client.\n\n\n### One-click deployment on Railway\n\nTo quickly deploy the RTT demo server on Railway:\n\n1. Click the following button:\n\n    [![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/w9wI4Q?referralCode=NwYPaQ)\n\n1. On the Railway deployment page, click **Deploy Now**. You see a serer configuration form.\n\n1. Fill in the `APP_ID`, `APP_CERTIFICATE`, `CUSTOMER_ID`, and `CUSTOMER_SECRET` from [Agora Console](https://console.agora.io/). \n\n1. To specify your object storage service (OSS), fill in the values for `OSS_ACCESS_KEY`, `OSS_SECRET_KEY`, and `OSS_BUCKET_NAME`.\n\n1. To complete the deployment, click **Deploy**. Railway creates a project instance and starts the build process. \n\n1. Switch to the **Settings** tab and scroll down to **Domains**. Click on **Generate Domain** to expose the service to the public internet and copy the displayed url.\n\n1. To test your demo server, follow the steps in [Test your implementation](#test-your-implementation) but replace `https://localhost:80` with your Railway url.\n\n### Build and run the demo business server\n\nTo set up the demo Real-time Transcription business server, do the following:\n\n1. **Download the Git repository**\n\n    Clone the `agora-rtt-server` repository to your development device using the following command:\n\n    ```bash\n    git clone https://github.com/AgoraIO/agora-rtt-server.git \u003cyour download directory\u003e\n    ```\n\n1. **Specify connection variables**\n\n    1. Open `agora-rtt-server\\src\\main\\java\\rtt\\RttTask.java` and update the values for `appId`, `appCertificate`, \n   `customerId`, and `customerSecret` from [Agora Console](https://console.agora.io/). \n    1. Specify the `ossAccessKey`, `ossSecretKey`, and the `ossBucketName` to configure cloud storage.\n\n1. **Build the server project**\n\n   To download the dependencies and initiate the Maven build process, execute the following command in the terminal :\n\n    ```bash\n    mvn clean install\n    ```\n\n1. **Start the server**\n\n    In your IDE, click **Start debugging** to launch the server. You see the following message in the terminal:\n\n    ```\n    RTT server started on port 80\n    ```\n\n## Test your implementation\n\nTo test your business server, take the following steps:\n\n1. Start an RTT task.\n\n    Execute the following command in a terminal window:\n\n    ```bash\n    curl -X POST -H \"Content-Type: application/json\" -d \"{\\\"UserId\\\": \\\"123\\\", \\\"channelName\\\": \\\"demo\\\"}\" http://localhost:80/rttStart\n    ```\n\n    The command makes an HTTP request to RTT within the JSON body. The body contains the following parameters:\n    * `UserId`: The parameter identifies the user starting the RTT task, so that the business server may check user's privileges and payment status.\n    * `channelName`: The channel for which the RTT task is to be started.\n\n    You see a message in the terminal confirming that the RTT task was started successfully. You also see a confirmation message displayed in the server console with the channel name and task ID.\n\n    \n1. Query the status of an RTT task.\n\n   Execute the following command in a terminal window:\n\n    ```bash\n    curl -X POST -H \"Content-Type: application/json\" -d \"{\\\"channelName\\\": \\\"demo\\\"}\" http://localhost:80/rttQuery\n    ```\n    Your server retrieves the task ID and builder token for the task associated with the `channelName` specified in the request and sends a request to query the task status. You see the retrieved status displayed in the terminal.\n\n1. Stop the RTT task.\n\n   Execute the following command in a terminal window:\n\n\n    ```bash\n    curl -X POST -H \"Content-Type: application/json\" -d \"{\\\"channelName\\\": \\\"demo\\\"}\" http://localhost:80/rttStop\n    ```\n\n     Your server retrieves the task ID and builder token for the task associated with the `channelName` and sends a request to stop the task. You see a confirmation message displayed in the terminal.\n\n\n## Reference\n\nThis section contains additional content that completes the information in this page, or points you to documentation that explains other aspects to this product.\n\n### REST API\n\nTo test the Real-time Transcription REST API, and to see request parameter details, refer to the [Postman Collection](https://documenter.getpostman.com/view/6319646/SVSLr9AM#69bd200a-7543-4104-8ccc-415741abbeb7). \n\n### List of supported languages\n\nUse the following language codes in the `recognizeConfig.language` parameter of the start request. The current version supports at most two languages, separated by commas. \n\n| Language                         | Code  | \n| -------------------------------- | ----- |\n| Chinese (Cantonese, Traditional) | zh-HK |\n| Chinese (Mandarin, Simplified)   | zh-CN |\n| Chinese (Taiwanese Putonghua)    | zh-TW |\n| English (India)                  | en-IN |\n| English (US)                     | en-US |\n| French (French)                  | fr-FR |\n| German (Germany)                 | de-DE |\n| Hindi (India)                    | hi-IN |\n| Indonesian (Indonesia)           | id-ID |\n| Italian (Italy)                  | it-IT |\n| Japanese (Japan)                 | ja-JP |\n| Korean (South Korea)             | ko-KR |\n| Portuguese (Portugal)            | pt-PT |\n| Spanish (Spain)                  | es-ES |\n\n### Supported third-party cloud storage services\n\nThe following third-party cloud storage service providers are supported:\n\n* [Alibaba Cloud](https://www.alibabacloud.com/product/oss)\n* [Amazon S3](https://aws.amazon.com/s3/?nc1=h_ls)\n* [Baidu AI Cloud](https://intl.cloud.baidu.com/product/bos.html)\n* [Google Cloud](https://cloud.google.com/storage)\n* [Huawei Cloud](https://www.huaweicloud.com/intl/en-us/product/obs.html)\n* [Kingsoft Cloud](https://en.ksyun.com/nv/product/KS3.html)\n* [Microsoft Azure](https://azure.microsoft.com/en-us/services/storage/blobs/)\n* [Qiniu Cloud](https://www.qiniu.com/en/products/kodo)\n* [Tencent Cloud](https://intl.cloud.tencent.com/product/cos)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagoraio%2Fagora-rtt-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagoraio%2Fagora-rtt-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagoraio%2Fagora-rtt-server/lists"}