abmoallim
09/07/2024, 5:50 PMawait vapi.start('2xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', {
metadata: interviewInfo,
onSpeech: (data) => {
console.log('Transcript:', data.text);
},
});
also I am trying to console log the transcript but both are not working for me.
I would appreciate any help please.Vapi
09/07/2024, 5:52 PMinterviewInfo is a properly formatted object that contains the data you want to pass. Here's an example of how you might structure it:
javascript
const interviewInfo = {
candidateName: "John Doe",
position: "Software Developer"
};
Regarding the start method, it looks like you're using it correctly. However, make sure that the 2xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx is replaced with a valid call token that you have obtained from your backend service.
For the onSpeech callback, it should work as intended if the call is set up correctly. If you're not seeing any console logs, there might be an issue with the call setup or the speech recognition service.
Here's a checklist to troubleshoot the issue:
1. Verify that you have a valid Public Key and that you've initialized the Vapi instance with it.
2. Ensure that the call token you're using is valid and has not expired.
3. Check your browser's console for any errors that might indicate what's going wrong.
4. Make sure that your browser has permission to use the microphone, as this is necessary for the onSpeech event to work.
5. If you're developing locally, ensure that you're serving your Next.js app over HTTPS, as modern browsers require a secure context for microphone access.
If you've gone through these steps and are still facing issues, please provide any error messages or additional context that might help in diagnosing the problem. If you need further assistance, don't hesitate to ask for more information.Vapi
09/07/2024, 5:52 PMabmoallim
09/07/2024, 5:58 PMVapi
09/07/2024, 5:58 PMmetadata property is supported by the VAPI SDK you are using. The property name might differ, or the feature might need to be enabled in a different way.
- Double-check that the interviewInfo object is correctly formatted and contains the data you expect to pass. It should be a plain object with key-value pairs.
2. Transcript not showing:
- The onSpeech callback should be triggered whenever speech is detected and transcribed. If it's not being called, it could be due to the speech not being recognized or an issue with the event hook-up.
- Verify that the microphone is capturing audio clearly and that there is no issue with the audio input.
- Check if there are any errors in the browser console that could indicate why the onSpeech event is not firing.
- Ensure that the SDK version you are using supports the onSpeech callback and that you are using it as per the documentation.
If you've verified all of the above and the issues persist, it might be helpful to look at the network requests in your browser's developer tools to see if the metadata is being sent and if there are any responses related to speech recognition.
If you're still unable to resolve the issue, please provide any error messages or console logs you're seeing, as they can offer more clues about what might be going wrong. If necessary, you can reach out to VAPI support for more detailed assistance with your specific implementation.Shubham Bajaj
09/09/2024, 2:36 PMabmoallim
09/09/2024, 2:53 PMShubham Bajaj
09/09/2024, 9:17 PM