🎤 Voice Input & 🔊 Audio Playback

✨ COMPLETE VOICE INTERACTION

NeuralAI APIs support bidirectional voice interaction: microphone input (Web Speech API, free) and TTS audio playback (Google Neural2, with tokens).

1. Voice Input (Microphone)

Use the Web Speech API (Chrome, Edge, Safari) to transcribe the user's voice to text.

javascript
// Initialize SpeechRecognition
const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
const recognition = new SpeechRecognition();
recognition.lang = 'it-IT';
recognition.continuous = false;

📋 Supported languages:

• it-IT - Italiano• en-US - English (USA)• en-GB - English (UK)• de-DE - Deutsch• fr-FR - Français• es-ES - Español• pt-BR - Português• ja-JP - 日本語

2. Audio Playback — TTS with Google neural voices

To generate audio from the AI response, use the prefix TTS: in the prompt.

javascript
const response = await fetch("https://app.neuralaiweb.com/functions/neuralaiPublicApi", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    api_key: "YOUR_API_KEY",

💰 Token Consumption:

  • Voice input (microphone): ✅ FREE — Browser Web Speech API
  • HTML5 audio playback: ✅ FREE
  • TTS Google Neural2: 💳 1 token / 300 characters
  • Music generation: 💳 1 token/second

⚠️ Important Notes

  • Supported browsers: Chrome, Edge, Safari
  • HTTPS required for Web Speech API
  • Audio URLs expire after 1 hour — download them for permanent use