Up to 10x cheaper than Eleven Labs and Play.ht.
Up to 2x cheaper than Amazon, Microsoft, and Google.
Number of Characters
one time
|
1M
|
Audio Duration
Estimated
|
~22 hours
|
Free
|
$0
|
Additional Usage
|
—
|
# Short endpoint: /stream
# - Up to 1,000 characters
# - Synchronous, instant response (0.3s+)
# - Streams back raw audio data
import requests
response = requests.post(
'https://api.v7.unrealspeech.com/stream',
headers = {
'Authorization' : 'Bearer YOUR_API_KEY'
},
json = {
'Text': '''<YOUR_TEXT>''', # Up to 1,000 characters
'VoiceId': '<VOICE_ID>', # Scarlett, Dan, Liv, Will, Amy
'Bitrate': '192k', # 320k, 256k, 192k, ...
'Speed': '0', # -1.0 to 1.0
'Pitch': '1', # 0.5 to 1.5
'Codec': 'libmp3lame', # libmp3lame or pcm_mulaw
}
)
with open('audio.mp3', 'wb') as f:
f.write(response.content)
// Short endpoint: /stream
// - Up to 1,000 characters
// - Synchronous, instant response (0.3s+)
// - Streams back raw audio data
const axios = require('axios');
const fs = require('fs');
const headers = {
'Authorization': 'Bearer YOUR_API_KEY',
};
const data = {
'Text': '<YOUR_TEXT>', // Up to 1,000 characters
'VoiceId': '<VOICE_ID>', // Scarlett, Dan, Liv, Will, Amy
'Bitrate': '192k', // 320k, 256k, 192k, ...
'Speed': '0', // -1.0 to 1.0
'Pitch': '1', // 0.5 to 1.5
'Codec': 'libmp3lame', // libmp3lame or pcm_mulaw
};
axios({
method: 'post',
url: 'https://api.v7.unrealspeech.com/stream',
headers: headers,
data: data,
responseType: 'stream'
}).then(function (response) {
response.data.pipe(fs.createWriteStream('audio.mp3'))
});
// Medium endpoint: /speech
// - Up to 3,000 characters
// - Synchronous, takes ~1s per 700 chars
// - Returns MP3 and JSON timestamp URLs
const axios = require('axios');
const headers = {
'Authorization': 'Bearer YOUR_API_KEY',
};
const data = {
'Text': '<YOUR_TEXT>', // Up to 3,000 characters
'VoiceId': '<VOICE_ID>', // Scarlett, Dan, Liv, Will, Amy
'Bitrate': '192k', // 320k, 256k, 192k, ...
'Speed': '0', // -1.0 to 1.0
'Pitch': '1', // 0.5 to 1.5
'TimestampType': ' ', // word or sentence
};
axios({
method: 'post',
url: 'https://api.v7.unrealspeech.com/speech',
headers: headers,
data: data,
}).then(function (response) {
console.log(JSON.stringify(response.data));
});
// Short endpoint: /stream
// - Up to 1,000 characters
// - Synchronous, instant response (0.3s+)
// - Streams back raw audio data
import React from "react";
import { View, Button, ActivityIndicator } from "react-native";
import { useUnrealSpeech, blobToDataURI } from "react-native-unrealspeech";
import { Audio } from "expo-av";
export default function App() {
const { stream, requestState } = useUnrealSpeech("YOUR_API_KEY");
const play = async (response: any) => {
try {
if (!response.ok) {
throw new Error("Network response was not ok");
}
const blobData = await response.blob();
const blob = new Blob([blobData], { type: "audio/mp3" });
const uri = await blobToDataURI(blob);
const { sound } = await Audio.Sound.createAsync({ uri }, {});
console.log(uri);
await sound.playAsync();
} catch (error) {
console.error("Error occurred while playing sound:", error);
}
};
const handleSpeak = async () => {
try {
const response = await stream(
"<YOUR_TEXT>", // Up to 1,000 characters
"<VOICE_ID>", // Scarlett, Dan, Liv, Will, Amy
"192k", // 320k, 256k, 192k, ...
0, // Speed: -1.0 to 1.0
1, // Pitch: 0.5 to 1.5
"libmp3lame" // Codec: libmp3lame or pcm_mulaw
);
play(response);
} catch (error) {
console.error("Error occurred while handling speak:", error);
}
};
return (
<View style={{ flex: 1, justifyContent: "center" }}>
{requestState === "loading" ? (
<ActivityIndicator />
) : (
<Button title="Speak" onPress={handleSpeak} />
)}
</View>
);
}
// Medium endpoint: /speech
// - Up to 3,000 characters
// - Synchronous, takes ~1s per 700 chars
// - Returns MP3 and JSON timestamp URLs
import React from "react";
import { StatusBar } from "expo-status-bar";
import { StyleSheet, Button, View, ActivityIndicator } from "react-native";
import { useUnrealSpeech } from "react-native-unrealspeech";
export default function App() {
const { speech, requestState } = useUnrealSpeech("YOUR_API_KEY");
const handleSpeak = async () => {
const mySpeech = await speech(
"<YOUR_TEXT>", // Up to 3,000 characters
"<VOICE_ID>", // Scarlett, Dan, Liv, Will, Amy
"192k", // 320k, 256k, 192k, ...
"sentence" // word or sentence
);
console.log(mySpeech);
};
return (
<View style={styles.container}>
<StatusBar style="auto" />
{requestState === "loading" ? (
<ActivityIndicator />
) : (
<Button title="Speak" onPress={handleSpeak} />
)}
</View>
);
}
const styles = StyleSheet.create(
{
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center"
}
}
);
# Short endpoint: /stream
# - Up to 1,000 characters
# - Synchronous, instant response (0.3s+)
# - Streams back raw audio data
curl -X POST "https://api.v7.unrealspeech.com/stream" -H "Content-Type: application/json" -H "Authorization: Bearer YOUR_API_KEY" --data '{"Text": "<YOUR_TEXT>", "VoiceId": "<VOICE_ID>", "Bitrate": "128k", "Speed": "0", "Pitch": "1", "Codec": "libmp3lame"}' --output audio.mp3