feat(mobile): track mobile app scaffold

This commit is contained in:
caoxiaozhu
2026-05-22 12:41:45 +08:00
parent 222ba0bfdc
commit 1f15699013
79 changed files with 16854 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
import { useAudioRecorder, RecordingPresets } from 'expo-audio';
export function useVoiceRecorder() {
const recorder = useAudioRecorder(RecordingPresets.HIGH_QUALITY);
return {
recorder,
async start() {
await recorder.prepareToRecordAsync();
recorder.record();
},
async stop() {
await recorder.stop();
return recorder.uri;
},
};
}
export async function transcribeVoice(uri: string) {
// 后续接入 /api/v1/mobile/voice/transcribe初始化阶段先返回可见占位结果。
return {
text: `已收到语音文件:${uri.split('/').pop() || 'voice-recording'}`,
confidence: 0,
};
}