PRX / speechmatics

Ruby client for Speechmatics API: https://speechmatics.com/api-details
MIT License
7 stars 15 forks source link

Allow video/mp4 in content_type checking, resolves #6 #7

Closed marvs closed 9 years ago

marvs commented 9 years ago

I was not able to add tests for this change since we need a zero-length mp4 file for this, and I cannot find a sample mp4 file that we can use.

kookster commented 9 years ago

Try this one?

blank.mp4 | uploaded via ZenHub

kookster commented 9 years ago

Thanks for the PR!

I think, upon rereading the SM support page, that probably the right validation is to make sure this is an 'audio' or a 'video' mime type file rather than just mp4.

Currently, the SM gem only checks for audio, which is wrong. My guess is SM uses ffmpeg to extract the audio to a standard format at some point in the automated processing, so probably best to just check for audio and video, as ffmpeg can pull audio out of practically any type of video file.

marvs commented 9 years ago

You are right, I may have misinterpreted that. Re-reading the FAQs it says "We support almost all file types, including aac, aif, m4a, mov, mp3, mp4, wav and more!" So they should support majority of audio and video formats :)

So should I update the PR and add in the sample mp4/test and the content type check or do you want to handle it from here?

Thanks!

kookster commented 9 years ago

I'd prefer if you made the change to the PR, but I may get to it eventually if you cannot.

(I'm not actively using this gem anymore, and I never used it for video, so it's not high on my list.)

marvs commented 9 years ago

Hello Andrew, I pushed the new commit to this PR, this includes the changes to checking audio and video files, as well as including the blank mp4 test file with tests. Thanks!

kookster commented 9 years ago

great work, thanks!

kookster commented 9 years ago

@marvs I just released 0.1.4 with this fix in the gem.