-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
165 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
export default { | ||
'omni-at-future-fest': { | ||
title: `Omni at Future Fest` | ||
}, | ||
'automatons-and-ai-for-javascript-junkies': { | ||
title: 'Automatons and AI for JavaScript Junkies', | ||
}, | ||
'sign-in-with-adobe-in-a-next-js-app': { | ||
title: 'Sign in with Adobe in a Next.js App', | ||
}, | ||
'omni-at-future-fest': { | ||
title: `Omni at Future Fest` | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
# Coming Soon | ||
import {Callout} from 'nextra/components' | ||
|
||
<Callout type='info'> | ||
We're currently building this feature. | ||
</Callout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
Our technology offers two primary services: | ||
|
||
#### WhatsApp Bot: Our WhatsApp bot effortlessly translates your voice notes into any language you desire. To find out how to use it, refer to the "WhatsApp Bot" section of our documentation. | ||
#### Discord Bot: Our Discord bot provides similar translation services on the Discord platform. To find out how to use it, refer to the "Discord Bot" section of our documentation. | ||
#### WhatsApp Bot: | ||
|
||
Our WhatsApp bot effortlessly translates your voice notes into any language you desire. To find out how to use it, refer to the "WhatsApp Bot" section of our documentation. | ||
|
||
#### Discord Bot: | ||
|
||
Our Discord bot provides similar translation services on the Discord platform. To find out how to use it, refer to the "Discord Bot" section of our documentation. | ||
|
||
>For commercial work or collaborations, please fill out this [form](https://docs.google.com/forms/d/1begM4VfB0s5kWDUXLhwviJXF8QoRekW8fafNuv25bJY/viewform?edit_requested=true). We look forward to working with you! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
# Coming Soon | ||
import {Callout} from 'nextra/components' | ||
|
||
<Callout type='info'> | ||
We're currently building this feature. | ||
</Callout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
# Coming Soon | ||
import {Callout} from 'nextra/components' | ||
|
||
<Callout type='info'> | ||
We're currently building this feature. | ||
</Callout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
# Coming Soon | ||
import {Callout} from 'nextra/components' | ||
|
||
<Callout type='info'> | ||
We're currently building this feature. | ||
</Callout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import {Callout} from 'nextra/components' | ||
|
||
# Examples of API Usage | ||
|
||
We've built some common use cases for both copy-pasting, and to help developers. | ||
|
||
See the [API Reference](https://getomni.app/api) to see the API endpoints. | ||
|
||
<Callout> | ||
Would you like to add an example? Open a [Pull Request](https://github.com/grayhatdevelopers/omni-docs/blob/main/developers/examples.mdx) on this page. | ||
</Callout> | ||
|
||
## Different models, different use cases. | ||
|
||
You can create scripts which use models conditionally. In the following NodeJS example, we use `babelfish-micro` for audios, and `babelfish` for video. | ||
|
||
```typescript copy showLineNumbers filename="dub_script.js" | ||
const axios = require('axios'); | ||
const readline = require('readline'); | ||
const fs = require('fs'); | ||
|
||
const rl = readline.createInterface({ | ||
input: process.stdin, | ||
output: process.stdout | ||
}); | ||
|
||
function promptUser() { | ||
rl.question('Enter the path of the file: ', async (filePath) => { | ||
try { | ||
const fileBuffer = fs.readFileSync(filePath); | ||
|
||
const isAudioFile = isAudio(filePath); | ||
const model = isAudioFile ? 'babelfish-micro' : 'babelfish'; | ||
const preserveBackground = !isAudioFile; | ||
const preservePace = !isAudioFile; | ||
|
||
const response = await sendRequest(fileBuffer, model, preserveBackground, preservePace); | ||
|
||
console.log('Response:', response.data); | ||
} catch (error) { | ||
console.error('Error:', error.message); | ||
} finally { | ||
rl.close(); | ||
} | ||
}); | ||
} | ||
|
||
function isAudio(filePath) { | ||
const audioExtensions = ['.mp3', '.wav', '.ogg', '.aac', '.flac']; | ||
const fileExtension = filePath.toLowerCase().slice(filePath.lastIndexOf('.')); | ||
return audioExtensions.includes(fileExtension); | ||
} | ||
|
||
async function sendRequest(fileBuffer, model, preserveBackground, preservePace) { | ||
const apiUrl = 'https://getomni.app/api/dub'; | ||
|
||
const formData = new FormData(); | ||
formData.append('file', fileBuffer, { filename: 'audio_or_video_file' }); | ||
formData.append('modelName', model); | ||
formData.append('preserveBackground', preserveBackground); | ||
formData.append('preservePace', preservePace); | ||
|
||
const response = await axios.post(apiUrl, formData, { | ||
headers: { | ||
'Content-Type': 'multipart/form-data', | ||
}, | ||
}); | ||
|
||
return response; | ||
} | ||
|
||
promptUser(); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
# Coming Soon | ||
import {Callout} from 'nextra/components' | ||
|
||
<Callout type='info'> | ||
We're currently building this feature. | ||
</Callout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
# Coming Soon | ||
import {Callout} from 'nextra/components' | ||
|
||
<Callout type='info'> | ||
We're currently building this feature. | ||
</Callout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
# Coming Soon | ||
import {Callout} from 'nextra/components' | ||
|
||
<Callout type='info'> | ||
We're currently building this feature. | ||
</Callout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters