2
Google Cloud Speech APIを使用しようとしているので、オーディオファイルを渡して翻訳されたテキストを受け取ることができますが、私は統合に固執しています。私はすでにAPIキーと必要なものはすべて持っていますが、それをネイティブに反応させる方法を見つけることはできません。ドキュメントには、node.js(javascriptの部分から)の説明しかありません。また、1つのOSのみをサポートしている複数のライブラリがあります。誰かがそれに成功した?リアクションネイティブのGoogle Cloudスピーチ
ドキュメントからのNode.js例:
// Imports the Google Cloud client library
const Speech = require('@google-cloud/speech');
// Your Google Cloud Platform project ID
const projectId = 'YOUR_PROJECT_ID';
// Instantiates a client
const speechClient = Speech({
projectId: projectId
});
// The name of the audio file to transcribe
const fileName = './resources/audio.raw';
// The audio file's encoding and sample rate
const options = {
encoding: 'LINEAR16',
sampleRate: 16000
};
// Detects speech in the audio file
speechClient.recognize(fileName, options)
.then((results) => {
const transcription = results[0];
console.log(`Transcription: ${transcription}`);
});
アンドロイドとiOSのネイティブモジュールを作成するだけで、独自の実装を開発するだけです。 –