-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
litongjava
committed
Oct 24, 2023
1 parent
006a88d
commit 644c2d5
Showing
12 changed files
with
151 additions
and
46 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
This file contains 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
This file contains 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
42 changes: 42 additions & 0 deletions
42
...ndroid.java/app/src/main/java/com/litongjava/whisper/android/java/task/LoadModelTask.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.litongjava.whisper.android.java.task; | ||
|
||
import android.content.Context; | ||
import android.os.Build; | ||
import android.widget.TextView; | ||
|
||
import com.blankj.utilcode.util.ThreadUtils; | ||
import com.litongjava.jfinal.aop.Aop; | ||
import com.litongjava.whisper.android.java.services.WhisperService; | ||
|
||
import java.io.File; | ||
|
||
public class LoadModelTask extends ThreadUtils.Task<Object> { | ||
private final Context context; | ||
private final TextView tv; | ||
public LoadModelTask(Context context,TextView tv) { | ||
this.tv = tv; | ||
this.context=context; | ||
} | ||
|
||
@Override | ||
public Object doInBackground() { | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | ||
Aop.get(WhisperService.class).loadModel(context,tv); | ||
}else{ | ||
tv.append("not supported android devices"); | ||
} | ||
return null; | ||
} | ||
|
||
@Override | ||
public void onSuccess(Object result) { | ||
} | ||
|
||
@Override | ||
public void onCancel() { | ||
} | ||
|
||
@Override | ||
public void onFail(Throwable t) { | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...id.java/app/src/main/java/com/litongjava/whisper/android/java/task/TranscriptionTask.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.litongjava.whisper.android.java.task; | ||
|
||
import android.content.Context; | ||
import android.os.Build; | ||
import android.widget.TextView; | ||
|
||
import com.blankj.utilcode.util.ThreadUtils; | ||
import com.litongjava.jfinal.aop.Aop; | ||
import com.litongjava.whisper.android.java.services.WhisperService; | ||
|
||
import java.io.File; | ||
|
||
public class TranscriptionTask extends ThreadUtils.Task<Object> { | ||
private final TextView tv; | ||
private final File sampleFile; | ||
|
||
public TranscriptionTask(TextView tv, File sampleFile) { | ||
this.tv = tv; | ||
this.sampleFile = sampleFile; | ||
|
||
} | ||
|
||
@Override | ||
public Object doInBackground() { | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | ||
Aop.get(WhisperService.class).transcribeSample(tv, sampleFile); | ||
}else{ | ||
tv.append("not supported android devices"); | ||
} | ||
return null; | ||
} | ||
|
||
@Override | ||
public void onSuccess(Object result) { | ||
} | ||
|
||
@Override | ||
public void onCancel() { | ||
} | ||
|
||
@Override | ||
public void onFail(Throwable t) { | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...a/com/whispercppdemo/whisper/CpuInfo.java → .../com/whispercpp/java/whisper/CpuInfo.java
This file contains 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
2 changes: 1 addition & 1 deletion
2
...hispercppdemo/whisper/WhisperContext.java → ...ispercpp/java/whisper/WhisperContext.java
This file contains 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
2 changes: 1 addition & 1 deletion
2
...spercppdemo/whisper/WhisperCpuConfig.java → ...percpp/java/whisper/WhisperCpuConfig.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.whispercppdemo.whisper; | ||
package com.whispercpp.java.whisper; | ||
|
||
import android.os.Build; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...om/whispercppdemo/whisper/WhisperLib.java → ...m/whispercpp/java/whisper/WhisperLib.java
This file contains 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
2 changes: 1 addition & 1 deletion
2
.../whispercppdemo/whisper/WhisperUtils.java → ...whispercpp/java/whisper/WhisperUtils.java
This file contains 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
This file contains 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