Skip to content

Commit

Permalink
avp patch
Browse files Browse the repository at this point in the history
  • Loading branch information
laves committed Jul 20, 2023
1 parent 6153c65 commit 85f1853
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion demo/android/OctopusDemo/octopus-demo-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ dependencies {
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation 'ai.picovoice:octopus-android:1.2.2'
implementation 'ai.picovoice:android-voice-processor:1.0.1'
implementation 'ai.picovoice:android-voice-processor:1.0.2'

// Espresso UI Testing
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
public class MainActivity extends AppCompatActivity {

private static final String ACCESS_KEY = "{YOUR_ACCESS_KEY_HERE}";

private static final int MAX_RECORDING_SEC = 120;

private final VoiceProcessor voiceProcessor = VoiceProcessor.getInstance();
Expand Down Expand Up @@ -262,19 +263,19 @@ public void run() {

setUIInteractivity(false);
setUIState(UIState.INDEXING);
taskExecutor.execute(() -> {
try {
voiceProcessor.stop();
} catch (VoiceProcessorException e) {
displayError(e.toString(), Toast.LENGTH_LONG);
return;
}
try {
voiceProcessor.stop();
} catch (VoiceProcessorException e) {
displayError(e.toString(), Toast.LENGTH_LONG);
return;
}

short[] pcmDataArray = new short[pcmData.size()];
for (int i = 0; i < pcmData.size(); ++i) {
pcmDataArray[i] = pcmData.get(i);
}
short[] pcmDataArray = new short[pcmData.size()];
for (int i = 0; i < pcmData.size(); ++i) {
pcmDataArray[i] = pcmData.get(i);
}

taskExecutor.execute(() -> {
try {
metadata = octopus.indexAudioData(pcmDataArray);
} catch (OctopusException e) {
Expand Down

0 comments on commit 85f1853

Please sign in to comment.