undebate
undebate copied to clipboard
Issue#13 transcribe
closes issue#13
(ok,ko) came from me and I learned it from someone else. I like it because it's way shorter than resolve and reject, and they are the reverse of each other, and If someone throws a punch (error) you get knocked out (ko'd).
I have code spell checker installed in VSC to help with spelling -but it has it's disadvantages too, like it doesn't recognize variable name. It would give you a little squiggly under Prommise and under receivec
On 6/15/2020 11:53 AM, MrNanosh wrote:
@MrNanosh commented on this pull request.
In app/models/transcribe.js https://github.com/EnCiv/undebate/pull/209#discussion_r440355518:
+const Joi = require('joi') +const MongoModels = require('mongo-models') + +const schema = Joi.object({
- _id: Joi.object(),
- path: Joi.string(),
- subject: Joi.string().required(),
- description: Joi.string().required(),
- component: Joi.object(),
- userId: Joi.string(), +})
+class Transcribe extends MongoModels {
- static create(obj) {
return new Prommise(async, (ok, ko) => {
JS Promises should be spelled with one m. async followed by a comma seems to be a syntax error. ko and ok are parameters but are vague.
In app/models/transcribe.js https://github.com/EnCiv/undebate/pull/209#discussion_r440356173:
- path: Joi.string(),
- subject: Joi.string().required(),
- description: Joi.string().required(),
- component: Joi.object(),
- userId: Joi.string(), +})
+class Transcribe extends MongoModels {
- static create(obj) {
return new Prommise(async, (ok, ko) => {
try {
const doc = new Transcribe(obj)
const result = await this.insertOne(doc)
if (result && result.length === 1) ok(result[0])
else {
const msg = ` unexpected number of results receivec ${results.length}`
received is misspelled.
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/EnCiv/undebate/pull/209#pullrequestreview-430878242, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZJ537F5KLBBQLO5MMGKBDRWZUZJANCNFSM4N3AA4ZA.
Cloudinary process: We use the cloudinary api to upload the video file to cloudinary and google speech to text api. We use the video url and replace the .mp4 extension with .transcript . Once we do that we can call the url and extract the contents of the .transcript file.
Just reached out to cloudinary, this is what they said: "The transcription gets queued in an async process, so you'll need to wait for that process to finish. I did notice that the documentation doesn't include those details, so I will have them add it but first let me test it."
I will try to get an estimate of the wait time, if the wait time is too long we can just do google transcribe streaming
In https://cloudinary.com/documentation/google_ai_video_transcription_addon#:~:text=With%20the%20Google%20AI%20Video,best%20possible%20speech%20recognition%20results.it says:
The google_speech parameter value activates a call to Google's Cloud
Speech API, which is performed _asynchronously after your original
method call is completed_. Thus your original method call response
displays a pending status:
...
"info": {
"raw_convert": {
"google_speech": {
"status": "pending"
}
}
}
...
When the google_speech request is complete (may take several seconds
or minutes depending on the length of the video), a new raw file is
created in your account with the same public ID as your video or
audio file and with the .transcript file extension.
If you also provided a notification_url in your method call, the
specified URL then receives a notification when the process completes:
Here is the documentation on notifications:
https://cloudinary.com/documentation/notifications
We are going to have to create athis.app.post(...) handler in server.js. But we should keep putting feature specific code in there - but lets get it working first and then clean it up. I've got time to talk this through on Friday if anyone's available.
On 7/16/2020 7:53 PM, epg323 wrote:
Just reached out to cloudinary, this is what they said: "The transcription gets queued in an async process, so you'll need to wait for that process to finish. I did notice that the documentation doesn't include those details, so I will have them add it but first let me test it."
I will try to get an estimate of the wait time, if the wait time is too long we can just do google transcribe streaming
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/EnCiv/undebate/pull/209#issuecomment-659805593, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZJ536VOBU6IA6GIRU5KULR364LFANCNFSM4N3AA4ZA.