🚀 PIG AI 新版来袭:AI能力全面升级! 点击了解一下?
使用 Azure OpenAI 的 Whisper 模型进行语音转文本
<dependency> <groupId>org.springframework.ai</groupId> <artifactId>spring-ai-azure-openai-spring-boot-starter</artifactId> </dependency>
spring.ai.azure.openai.api-key=YOUR_API_KEY spring.ai.azure.openai.endpoint=YOUR_ENDPOINT spring.ai.azure.openai.audio.model=whisper-1
@Autowired private TranscriptionClient transcriptionClient; // 转录音频 TranscriptionResponse response = transcriptionClient.call( new TranscriptionPrompt(audioFile) );