Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
lincollincol committed Aug 30, 2022
2 parents 25757f2 + 71cb971 commit 9adb411
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ allprojects {
```
``` groovy
dependencies {
implementation 'com.github.lincollincol:amplituda:2.1.5'
implementation 'com.github.lincollincol:amplituda:x.y.z'
}
```

Expand Down Expand Up @@ -117,6 +117,35 @@ amplituda.processAudio(<audio>, Compress.withParams(Compress.AVERAGE, 5));
// Approximate output data size - 60 [duration] * 5 [preferredSamplePerSecond] = 300 [samples]
```

#### • Cache output data
``` java
/**
* Cache result data (optional)
* Amplituda provides cache implementation.
* You can reuse already processed audio files.
* Cache states:
* - Cache.REUSE - use already cached data or write
* processed data to cache (if cache data doesn't exist)
* - Cache.REFRESH - update existing cache data.
* WARNING: use this cache state, when you need to update existing cache data
* Key (optional) - custom cache key. Should be unique for each audio.
*/

// Enable amplituda cache feature:
amplituda.processAudio(<audio>, Cache.withParams(Cache.REUSE));
// Cache with custom key. The key should be unique
amplituda.processAudio(<audio>, Cache.withParams(Cache.REUSE, "my-unique-key"));

// Clear all cache data
amplituda.clearCache();
// Clear cache data for specific audio (if exist)
amplituda.clearCache(<audio>);
amplituda.clearCache("/storage/emulated/0/Music/Linc - Amplituda.mp3", false);
// Clear cache data by custom key.
amplituda.clearCache("my-unique-key", true);

```

#### • Handle progress
``` java
/**
Expand Down

0 comments on commit 9adb411

Please sign in to comment.