2017年5月8日 星期一

讓youtbe可以分享播放聯結

http://stackoverflow.com/questions/11178041/android-youtube-share-a-youtube-video-to-my-app

This worked for me. Add this intent filter to your manifest file to make your application appear in the share list of the youtube application.
<intent-filter>
   <action android:name="android.intent.action.SEND" />
   <category android:name="android.intent.category.DEFAULT" />              
   <data android:host="www.youtube.com" android:mimeType="text/*" />
</intent-filter>

2017年4月15日 星期六

JAVA Google speech recognition

  private HttpURLConnection makeConnection(
      URL url,
      byte[] postBody,
      long position,
      long length,
      boolean allowGzip,
      boolean followRedirects) throws IOException
{

setRequestProperty



https://zh.wikipedia.org/wiki/FLAC





https://docs.python.org/2/library/subprocess.html




 temp = tempfile.NamedTemporaryFile(suffix='.wav', delete=False)
https://docs.python.org/2/library/tempfile.html


tempfile.NamedTemporaryFile([mode='w+b'[bufsize=-1[suffix=''[prefix='tmp'[dir=None[delete=True]]]]]])
This function operates exactly as TemporaryFile() does, except that the file is guaranteed to have a visible name in the file system (on Unix, the directory entry is not unlinked). That name can be retrieved from the name attribute of the returned file-like object. Whether the name can be used to open the file a second time, while the named temporary file is still open, varies across platforms (it can be so used on Unix; it cannot on Windows NT or later). If delete is true (the default), the file is deleted as soon as it is closed.
The returned object is always a file-like object whose file attribute is the underlying true file object. This file-like object can be used in a with statement, just like a normal file.
New in version 2.3.
New in version 2.6: The delete parameter.





http://writingminds.github.io/ffmpeg-android-java/

2017年4月14日 星期五

autosub

https://github.com/agermanidis/autosub#autosub--


Install AutoSub Step to Step in Windows with Translate subtitle

https://github.com/agermanidis/autosub/issues/31


commands:
autosub_app.py -S zh-TW -D zh-TW sea.mp4

Google 语音识别 API (Part 2)
http://blog.laobubu.net/archivers/google-speech-api-pt2

2017年4月1日 星期六

canvas

http://www.jianshu.com/p/336f90f0026f


drawRect
https://developer.android.com/reference/android/graphics/Canvas.html#drawRect(float, float, float, float, android.graphics.Paint)



12down voteaccepted
From the Android documentation - protected void dispatchDraw (Canvas canvas):
Called by draw to draw the child views. This may be overridden by derived classes to gain control just before its children are drawn (but after its own view has been drawn).


SimpleDecoder, textRenderer, SimpleSubtitleDecoder & WebVtt

https://www.draw.io/ 

WebVTT cue timestamp consists of a U+003C LESS-THAN SIGN character (<), followed by a WebVTT timestamp representing the time that the given point in the cue becomes active, followed by a U+003E GREATER-THAN SIGN character (>). The time represented by the WebVTT timestamp must be greater than the times represented by any previous WebVTT cue timestamps in the cue, as well as greater than the cue’s start time offset, and less than the cue’s end time offset.


textLayout = new StaticLayout(cueText, textPaint, availableWidth, textAlignment, spacingMult,
        spacingAdd, true);