AudioIntell.ai API Documentation
Overview
The AudioIntell.ai API offers two main endpoints for audio analysis: Synthetic Detection and Vocal Emphasis Detection.
These APIs allow you to send audio files for analysis and receive detailed predictions and data about the content.
Download API Manual
If you would like to download the AudioIntell.ai API Manual click here
Synthetic Detection API
This endpoint predicts whether the provided audio is AI-generated or not.
Endpoint
URL: https://app.audiointell.ai/api/synthetic-detection
Method: POST
Request Format
Form Data:
- email: The authorized user’s email address.
- password: The authorized user’s password.
- audio: The audio file to be analyzed (.mp3 or .wav).
- content_type: A string specifying the type of content in the audio file. Valid values are 'music' and 'voice'.
Example Requests
Using cURL
curl -X POST -F "email=user@example.com" -F "password=yourpassword" -F "audio=@/path/to/your/file.mp3" -F "content_type=music" https://app.audiointell.ai/api/synthetic-detection
Using Python (requests library)
import requests
url = 'https://app.audiointell.ai/api/synthetic-detection'
audio_file_path = '/path/to/your/file.mp3'
content_type = 'music'
email = 'user@example.com'
password = 'yourpassword'
files = {'audio': open(audio_file_path, 'rb')}
data = {'content_type': content_type, 'email': email, 'password': password}
response = requests.post(url, files=files, data=data)
if response.status_code == 200:
prediction = response.json().get('prediction')
print('Prediction:', prediction)
else:
print('Error:', response.json().get('error'))
Using JavaScript (Fetch API)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AudioIntell API Test</title>
</head>
<body>
<h1>Upload an Audio File</h1>
<form id="uploadForm">
<label for="email">Email:</label>
<input type="email" id="email" name="email" required>
<br><br>
<label for="password">Password:</label>
<input type="password" id="password" name="password" required>
<br><br>
<label for="audio">Select an audio file (mp3 or wav):</label>
<input type="file" id="audio" name="audio" accept=".mp3, .wav" required>
<br><br>
<label for="contentType">Select content type:</label>
<select id="contentType" name="content_type" required>
<option value="music">Music</option>
<option value="voice">Voice</option>
</select>
<br><br>
<button type="submit">Upload</button>
</form>
<h2>Prediction Result</h2>
<p id="result"></p>
<script>
document.getElementById('uploadForm').addEventListener('submit', function(event) {
event.preventDefault();
const formData = new FormData();
const email = document.getElementById('email').value;
const password = document.getElementById('password').value;
const audioFile = document.getElementById('audio').files[0];
const contentType = document.getElementById('contentType').value;
formData.append('email', email);
formData.append('password', password);
formData.append('audio', audioFile);
formData.append('content_type', contentType);
fetch('https://app.audiointell.ai/api/synthetic-detection', {
method: 'POST',
body: formData
})
.then(response => response.json())
.then(data => {
if (data.error) {
document.getElementById('result').textContent = `Error: ${data.error}`;
} else {
document.getElementById('result').textContent = `Prediction: ${data.prediction}`;
}
})
.catch(error => {
document.getElementById('result').textContent = `Error: ${error.message}`;
});
});
</script>
</body>
</html>
Response Format
The API responds with a JSON object.
Success Responses:
{
"prediction": "AI Generated Audio - Likelihood of AI: 99.58%"
}
“Success message” can be:
- “AI Generated Audio - Likelihood of AI: 99.58%”
- “Not AI Generated Audio - Likelihood of AI: 4.34%”
Error Responses:
{
"error": "Error message"
}
- “Email and password are required”
- “Invalid email or password”
- “No audio file provided”
- “No selected file”
- “Invalid content type”
- “Invalid file type. Only .wav and .mp3 are allowed”
- “Error”
Vocal Emphasis Detection API
This endpoint provides transcription and emphasis analysis of the provided vocal audio file.
Endpoint
URL: https://app.audiointell.ai/api/vocal-emphasis-detection
Method: POST
Request Format
Form Data:
- email: The authorized user’s email address.
- password: The authorized user’s password.
- audio: The audio file to be analyzed (.mp3 or .wav).
- response_type: A string specifying the type of response. Valid values are 'table', 'html', and 'both'.
Example Requests
Using cURL
curl -X POST -F "email=user@example.com" -F "password=yourpassword" -F "audio=@/path/to/your/file.mp3" -F "response_type=table" https://app.audiointell.ai/api/vocal-emphasis-detection
Using Python (requests library)
import requests
url = 'https://app.audiointell.ai/api/vocal-emphasis-detection'
audio_file_path = '/path/to/your/file.mp3'
response_type = 'table'
email = 'user@example.com'
password = 'yourpassword'
files = {'audio': open(audio_file_path, 'rb')}
data = {'response_type': response_type, 'email': email, 'password': password}
response = requests.post(url, files=files, data=data)
if response.status_code == 200:
result = response.json()
if response_type == 'table':
print('Emphasis Data:', result.get('emphasis_data'))
elif response_type == 'html':
print('Transcription:', result.get('transcription'))
else:
print('Emphasis Data:', result.get('emphasis_data'))
print('Transcription:', result.get('transcription'))
else:
print('Error:', response.json().get('error'))
Using JavaScript (Fetch API)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AudioIntell API Test</title>
</head>
<body>
<h1>Upload an Audio File</h1>
<form id="uploadForm">
<label for="email">Email:</label>
<input type="email" id="email" name="email" required>
<br><br>
<label for="password">Password:</label>
<input type="password" id="password" name="password" required>
<br><br>
<label for="audio">Select an audio file (mp3 or wav):</label>
<input type="file" id="audio" name="audio" accept=".mp3, .wav" required>
<br><br>
<label for="responseType">Select response type:</label>
<select id="responseType" name="response_type" required>
<option value="table">Table (CSV Data)</option>
<option value="html">HTML (Transcription)</option>
<option value="both">Both Table and HTML</option>
</select>
<br><br>
<button type="submit">Upload</button>
</form>
<h2>Analysis Result</h2>
<p id="result"></p>
<script>
document.getElementById('uploadForm').addEventListener('submit', function(event) {
event.preventDefault();
const formData = new FormData();
const email = document.getElementById('email').value;
const password = document.getElementById('password').value;
const audioFile = document.getElementById('audio').files[0];
const responseType = document.getElementById('responseType').value;
formData.append('email', email);
formData.append('password', password);
formData.append('audio', audioFile);
formData.append('response_type', responseType);
fetch('https://app.audiointell.ai/api/vocal-emphasis-detection', {
method: 'POST',
body: formData
})
.then(response => response.json())
.then(data => {
if (data.error) {
document.getElementById('result').textContent = `Error: ${data.error}`;
} else {
if (responseType === 'table') {
document.getElementById('result').textContent = `Emphasis Data: ${JSON.stringify(data.emphasis_data)}`;
} else if (responseType === 'html') {
document.getElementById('result').innerHTML = `Transcription: ${data.transcription}`;
} else {
document.getElementById('result').textContent = `Emphasis Data: ${JSON.stringify(data.emphasis_data)}`;
document.getElementById('result').innerHTML += `
Transcription: ${data.transcription}`;
}
}
})
.catch(error => {
document.getElementById('result').textContent = `Error: ${error.message}`;
});
});
</script>
</body>
</html>
Response Format
The API responds with a JSON object.
Success Responses:
{
"emphasis_data": [
{
"context": "I am not reading",
"emphasis": 1.27,
"phrase": "I am not"
},
{
"context": "I am not reading sing but I am getting louder",
"emphasis": 2.37,
"phrase": "reading"
},
{
"context": "reading sing but I am getting louder",
"emphasis": 27.04,
"phrase": "sing but I am getting louder"
}
],
"transcription": "<span style=\"color:rgb(46,0,0);font-size:22px;\">I am not </span><span style=\"color:rgb(76,0,0);font-size:27px;\">reading </span><span style=\"color:rgb(255,0,0);font-size:146px;\">sing but I am getting louder </span>"
}
The "Success" response will include either or both:
- emphasis_data: Array of objects representing phrases, their context, and their emphasis level.
- transcription: The HTML-formatted transcription of the audio with emphasis levels visually represented.
Error Responses:
{
"error": "Error message"
}
- “Email and password are required”
- “Invalid email or password”
- “No audio file provided”
- “No selected file”
- “Invalid response type”
- “Invalid file type. Only .wav and .mp3 are allowed”
- “Error”
Contact
For further assistance, please contact support at roman@audiointell.ai