This document describes how to test the new GPT-4o Audio model support.
- Added new setting:
openai-model - Two options:
whisper-1(default): Fast, $0.006/minutegpt-4o-audio-preview: Advanced, $0.06/minute
- Updated
transcribe_openai()to acceptmodelparameter - Added new function
transcribe_gpt4o_audio():- Uses
/v1/chat/completionsendpoint (not/v1/audio/transcriptions) - Encodes audio to base64
- Sends as
input_audioin messages - Extracts text from chat completion response
- Timeout increased to 60 seconds (GPT-4o is slower)
- Uses
- Bound new setting:
this.openaiModel - Added environment variable:
OPENAI_MODEL - Python script routes to correct function based on model
- Have a valid OpenAI API key with GPT-4o access
- Rebuild and reinstall the applet:
make deb-clean make deb sudo apt install --reinstall ../voice-keyboard-perlover_1.0.0-1_all.deb
- Restart Cinnamon:
Alt+F2, typer, press Enter
- Right-click the applet icon → "Settings"
- Set "Whisper mode" to "OpenAI API"
- Verify new setting appears: "OpenAI Model"
- Verify dropdown has two options:
- "Whisper-1 (fast, $0.006/min)"
- "GPT-4o Audio (advanced, $0.06/min)"
- Verify tooltip explains the difference
- In settings, select "Whisper-1" model
- Enter your API key
- Set language to "Auto-detect"
- Left-click applet icon
- Speak clearly: "This is a test of Whisper one"
- Left-click again to stop
- Verify text is inserted correctly
- Check
~/.xsession-errorsfor log message: "Sending to OpenAI whisper-1 API..."
- In settings, select "GPT-4o Audio" model
- Keep same API key and language
- Left-click applet icon
- Speak clearly: "This is a test of GPT-4o audio model"
- Left-click again to stop
- Verify text is inserted correctly
- Check
~/.xsession-errorsfor log message: "Sending to OpenAI GPT-4o Audio API..."
- In settings, select "GPT-4o Audio" model
- Set language to "Russian"
- Left-click applet icon
- Speak in Russian: "Это тест модели GPT-4o"
- Left-click again to stop
- Verify Russian text is inserted correctly
- Temporarily set invalid API key
- Select "GPT-4o Audio" model
- Try to record
- Verify error notification appears
- Check
~/.xsession-errorsfor error message with status code 401
- Record same phrase with Whisper-1
- Note transcription time in logs
- Record same phrase with GPT-4o Audio
- Note transcription time in logs
- GPT-4o should be slower but potentially more accurate
- Fast processing (2-5 seconds typically)
- Good accuracy for clear speech
- Cost: $0.006 per minute of audio
- Uses multipart/form-data upload
- Slower processing (5-10 seconds typically)
- Better accuracy for complex speech
- Better handling of context, emotion, accents
- Cost: $0.06 per minute of audio (10x more expensive)
- Uses JSON with base64-encoded audio
- Check audio format is valid WAV
- Verify API key has GPT-4o access
- Check audio file size (max 25MB)
- GPT-4o response structure may have changed
- Check
~/.xsession-errorsfor full response - May need to update
transcribe_gpt4o_audio()function
- Check network connection
- Verify API key is valid and has credits
- Check OpenAI status: https://status.openai.com/
- This is expected - GPT-4o is more complex than Whisper
- Consider using Whisper-1 for most tasks
- Use GPT-4o only when you need better quality
For 1 hour of total recording:
- Whisper-1: $0.36
- GPT-4o Audio: $3.60 (10x more expensive)
For 1000 recordings of 10 seconds each (~2.7 hours):
- Whisper-1: ~$1.00
- GPT-4o Audio: ~$10.00
Recommendation: Use Whisper-1 by default, only use GPT-4o when you need the extra quality.
- Whisper API: https://platform.openai.com/docs/guides/speech-to-text
- GPT-4o Audio: https://platform.openai.com/docs/guides/audio (Preview)
- Pricing: https://openai.com/api/pricing/
- GPT-4o Audio is in preview and API may change
- Model name
gpt-4o-audio-previewmay change to stable version in future - Consider updating model name when GPT-4o Audio becomes stable
- base64 encoding increases payload size (~33% larger than raw audio)
- Timeout is 60 seconds for GPT-4o (vs 30 seconds for Whisper-1)