Fix: Forzar mimetype ogg para notas de voz PTT
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m11s
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m11s
- Preferir grabacion en ogg/opus en el navegador - Forzar mimetype a audio/ogg; codecs=opus para PTT en servidor - WhatsApp requiere ogg para notas de voz
This commit is contained in:
@@ -36,22 +36,25 @@ export function useAudioRecorder() {
|
||||
})
|
||||
|
||||
// Get preferred MIME type for recording
|
||||
// Prefer ogg/opus as it's required by WhatsApp for voice notes
|
||||
const getMimeType = (): string => {
|
||||
const types = [
|
||||
'audio/ogg;codecs=opus', // Preferred for WhatsApp PTT
|
||||
'audio/ogg',
|
||||
'audio/webm;codecs=opus',
|
||||
'audio/webm',
|
||||
'audio/ogg;codecs=opus',
|
||||
'audio/ogg',
|
||||
'audio/mp4',
|
||||
'audio/mpeg'
|
||||
]
|
||||
|
||||
for (const type of types) {
|
||||
if (MediaRecorder.isTypeSupported(type)) {
|
||||
console.log('[AudioRecorder] Using MIME type:', type)
|
||||
return type
|
||||
}
|
||||
}
|
||||
|
||||
console.warn('[AudioRecorder] No preferred type supported, using webm fallback')
|
||||
return 'audio/webm' // fallback
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user