Posts

Showing posts from November, 2016

2023-09-13, Wednesday, Cloudy

新工上遇上了挫折。寫好的東西達不到標準需要別人執手尾了。雖然同事說沒關係,但反應了自己的不足。有時反省自己為何做事總是不好,為何別人有留意或想到的事情自己總是忽略。現在覺得是自己天生的思考模式問題,可能看多少書都沒用。或者自己應該更適合做地盤呢類工作,而唔係IT。

Google Speech API with Cantonese

I am trying to convert some Cantonese audio clip into text with the Google Speech API. The example app on https://cloud.google.com/speech/docs/samples was good (I am using Java) and following the instruction I can get the example converting the sample clip into text. But than I get into trouble converting the Cantonese. Firstly, I can't get it converting Cantonese clip. It just returned blank result. I did two things to make it return some transcript. Setting the Language Code     RecognitionConfig config =         RecognitionConfig.newBuilder()             .setEncoding(AudioEncoding. LINEAR16 )             .setSampleRate( samplingRate ).setLanguageCode( "yue-Hant-HK" )             .build(); Using Audacity and record the clip with MONO channel, and export it as RAW type: File type: Other uncompressed files Header: RAW (header-less) Encoding: Signed 16-bit PCM And finally I got a response like below: INFO: Received response: results {  

Useful SSH usage

This post has a command that is useful about running SQL statement. https://gist.github.com/scy/6781836 The command is: mysql -e 'SHOW DATABASES;' -h 127.0.0.1 | ssh -L 3306:localhost:3306 remotehost cat This post is good too about ssh without password instead of using rsa key: http://serverfault.com/questions/241588/how-to-automate-ssh-login-with-password ssh-keygen -t rsa -b 2048 ssh-copy-id id@server