pietrop / digital-paper-edit-electron

Work in progress - digital paper edit project - Electron, Cross Platform Desktop app - Mac, Windows, Linux
https://pietropassarelli.net/autoedit
Other
103 stars 17 forks source link

fixed a few things for M1 arm64 release #80

Closed pietrop closed 2 years ago

pietrop commented 2 years ago

Is your Pull Request request related to another issue in this repository ?

https://github.com/pietrop/digital-paper-edit-electron/issues/79

Describe what the PR does

fixed dialog by moving to main process via ipc, fixed ffmpeg and ffprobe bin by adding arm64 arch folder and logic in that module, tested locally with npm start prod and dev, haven't tried packaging yet

State whether the PR is ready for review or whether it needs extra work

Work in progress

Additional context

NA

dgw commented 2 years ago

If I understand the templating language correctly here, this snippet restricts the display of DeepSpeech as an option to only x64 Mac (platform === 'darwin' is required). In 1.6.5-alpha.0 I can't see the DeepSpeech option any more on Windows 10.

https://github.com/pietrop/digital-paper-edit-electron/blob/6d0a43814f2118c028512759721b877d5d5cb17a/src/stt-settings/index.html#L268-L272

Would a condition like {!(platform === 'darwin' && platform.arch === 'arm64') && (<option etc.> work? That would display the DeepSpeech option on any platform that is not both Mac and M1.

pietrop commented 2 years ago

Sorry for the delay at @dgw

Does deepspeech work on Windows 10?

I wanted to remove the deepspeech option for mac M1 (arm64) because it doesn't support it yet.

I wasn't sure if it worked on linux and windows(?) so thought I'd remove that too.

You could change it to

- {process.platform==="darwin" && process.arch !=='arm64' &&( 
+ {process.platform==="darwin"  
+ && process.platform==="win32"
+ && process.platform === "linux" 
+ && process.arch !=='arm64' &&( 
 <option value="deepspeech"> 
   Mozilla Deepspeech (offline){" "} 
 </option>)} 

To bring back deepspeech to windows and linux (provided deepspeech is compatible with those OS)

I'd welcome a PR, if you got time to try it out (on a windows machine?) 😇


Node docs, links

dgw commented 2 years ago

Hi @pietrop,

I ultimately moved on from this tool for the current project as it has too many limitations—especially given that I need to collaborate with others. A cloud service seemed to be the best option for something that "just works" for my employer. I'm happy to toy with stuff like this on my own projects, but the project timeline from work didn't allow for it here.

Another thing I tried was tying together a couple of tools built on deepspeech using the WSL2 command line, which certainly got me farther than the paper-edit GUI. In that way, deepspeech "works on Windows 10", but it won't help with paper-edit until the promised graphical interface support rolls out. At that point it would become possible to install and run paper-edit inside WSL and use any STT library that works on a normal Linux desktop (but there's obviously no Windows Subsystem for macOS 😅).

As far as testing deepspeech compatibility within the app, natively on Windows 10, I can try to do so but there seem to be other places where it's been disabled in the paper-edit code. For example (from this patch):

https://github.com/pietrop/digital-paper-edit-electron/blob/e79f3187de354045081c9d1a8025914e3d58bcc2/src/ElectronWrapper/lib/transcriber/index.js#L10

Code later in that file references the imported module:

https://github.com/pietrop/digital-paper-edit-electron/blob/e79f3187de354045081c9d1a8025914e3d58bcc2/src/ElectronWrapper/lib/transcriber/index.js#L89

I saw a lot of commented-out stuff while poking around the code a bit just now to refresh my memory of what's where. Based on that, I doubt I'm up to tracking down all of the things I'd have to change just to try deepspeech under Windows, if it will even run.

Plus, I still don't understand how the templating works. You suggested a change that—to me—would enable deepspeech if the platform matches darwin, win32, and (&&) linux, when the platform can't be all 3 at the same time. Maybe the biggest limitation is just that I don't have any Electron experience, and can't justify spending the time to learn it just for this purpose.