This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cls | |
| @echo off | |
| set in_file=%1 | |
| echo in_file=%in_file% | |
| set out_file=%~dpn1.mp3 | |
| echo out_file=%out_file% | |
| ffmpeg.exe -i %in_file% -b:a 128K -vn "%out_file%" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ## settings | |
| CHT_IOT_STT_API_KEY=aaaaaaaa-bbbb-cccc-dddd-123456789ab | |
| PCM_FILE_FOR_STT=test.pcm | |
| ## script start | |
| if [ ! -f "${PCM_FILE_FOR_STT}" ]; then | |
| echo "ERROR:Cannot open pcm file @ ${PCM_FILE_FOR_STT}" | |
| exit 1 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public AudioFocusHelper(@NonNull Handler handler, int audioFocus) { | |
| mAudioFocus = audioFocus; | |
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | |
| Log.v(TAG, "System is above oreo"); | |
| mAudioAttributes = new AudioAttributes.Builder() | |
| .setUsage(AudioAttributes.USAGE_MEDIA) | |
| .setContentType(AudioAttributes.CONTENT_TYPE_SPEECH) | |
| .build(); | |
| mFocusRequest = new AudioFocusRequest.Builder(mAudioFocus) | |
| .setAudioAttributes(mAudioAttributes) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| String assetPath = "{the file name you want fom the asset directory}"; | |
| AssetManager asset = getApplication().getApplicationContext().getAssets(); | |
| FileDescriptor fd = asset.openFd(assetPath).getFileDescriptor(); | |
| MediaPlayer mp = new MediaPlayer(); | |
| mp.setDataSource(fd); | |
| mp.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { | |
| @Override | |
| public void onPrepared(MediaPlayer mediaPlayer) { | |
| Log.v(TAG, "[MUSIC] started"); | |
| mp.start(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ListForRead = 'C:\Users\User\Desktop\filelist.txt'; | |
| fid = fopen(ListForRead,'r'); | |
| if fid==-1 | |
| error(['cannot open the list=' ListForRead]); | |
| end | |
| DirForSave = 'donwload'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private void showAlertDialog(String msg) { | |
| final String m = msg; | |
| runOnUiThread(new Runnable() { | |
| @Override | |
| public void run() { | |
| AlertDialog.Builder alertDialog = new AlertDialog.Builder(getContext()); | |
| alertDialog.setTitle("Alert"); | |
| alertDialog.setMessage(m); | |
| alertDialog.setNeutralButton(android.R.string.ok, new DialogInterface.OnClickListener() { | |
| @Override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.lang.reflect.*; | |
| public class TestProxy { | |
| interface MyListener { | |
| void callback(Object event); | |
| } | |
| static class MyClass implements Runnable { | |
| private String id; | |
| private MyListener l = null; | |
| private Object lock = new Object(); |
NewerOlder