chore: test o4-transcribe

This commit is contained in:
Peng Xiao
2025-07-16 16:57:56 +08:00
parent cdff5c3117
commit 5758d5eba5

View File

@@ -135,14 +135,11 @@ export class AudioAttachmentBlock extends Entity<AttachmentBlockModel> {
if (!buffer) {
throw new Error('No audio buffer available');
}
const slices = await encodeAudioBlobToOpusSlices(buffer, 64000);
const files = slices.map((slice, index) => {
const blob = new Blob([slice], { type: 'audio/opus' });
return new File([blob], this.props.props.name + `-${index}.opus`, {
type: 'audio/opus',
});
});
return files;
return [
new File([buffer], this.props.props.name + '.mp3', {
type: 'audio/mpeg',
}),
];
},
});