chore: test o4-transcribe

This commit is contained in:
Peng Xiao
2025-07-16 16:57:56 +08:00
parent cdff5c3117
commit 5758d5eba5
@@ -135,14 +135,11 @@ export class AudioAttachmentBlock extends Entity<AttachmentBlockModel> {
if (!buffer) { if (!buffer) {
throw new Error('No audio buffer available'); throw new Error('No audio buffer available');
} }
const slices = await encodeAudioBlobToOpusSlices(buffer, 64000); return [
const files = slices.map((slice, index) => { new File([buffer], this.props.props.name + '.mp3', {
const blob = new Blob([slice], { type: 'audio/opus' }); type: 'audio/mpeg',
return new File([blob], this.props.props.name + `-${index}.opus`, { }),
type: 'audio/opus', ];
});
});
return files;
}, },
}); });