update libs

This commit is contained in:
Alexey Kuznetsov 2022-02-28 17:54:34 +03:00
commit 2cbeedfefb
3 changed files with 8 additions and 8 deletions

View file

@ -53,7 +53,7 @@ android {
dependencies {
testImplementation 'junit:junit:4.12'
implementation ('com.github.axet:android-audio-library:1.1.1') // implementation project(':android-audio-library')
implementation ('com.github.axet:android-audio-library:1.1.3') // implementation project(':android-audio-library')
implementation ('com.github.axet:wget:1.7.0') { exclude group: 'org.json', module: 'json' }
assets('com.google.android.exoplayer:exoplayer:2.7.3') { exclude group: 'com.android.support' }
}

View file

@ -567,12 +567,12 @@ public class RecordingActivity extends AppCompatThemeActivity {
int count = pitch.getMaxPitchCount(metrics.widthPixels);
AudioTrack.SamplesBuffer buf = new AudioTrack.SamplesBuffer(rs.info.format, count * recording.samplesUpdateStereo);
long cut = recording.samplesTime * Sound.getChannels(this) - buf.count;
long cut = recording.samplesTime * Sound.getChannels(this) - buf.capacity;
if (cut < 0)
cut = 0;
rs.open(cut, buf.count);
rs.open(cut, buf.capacity);
int len = rs.read(buf);
rs.close();

View file

@ -165,7 +165,7 @@ public class RecordingStorage {
while (!interrupt.get()) {
synchronized (bufferSizeLock) {
if (buffer == null || buffer.size() != bufferSize)
if (buffer == null || buffer.capacity != bufferSize)
buffer = new AudioTrack.SamplesBuffer(info.format, bufferSize);
}
@ -204,14 +204,14 @@ public class RecordingStorage {
int dbSize;
int readSizeUpdate;
if (dbBuffer != null) {
AudioTrack.SamplesBuffer bb = new AudioTrack.SamplesBuffer(info.format, dbBuffer.position + readSize);
AudioTrack.SamplesBuffer bb = new AudioTrack.SamplesBuffer(info.format, dbBuffer.pos + readSize);
dbBuffer.flip();
bb.put(dbBuffer);
bb.put(buffer, 0, readSize);
dbBuf = new AudioTrack.SamplesBuffer(info.format, bb.position);
dbSize = dbBuf.count;
dbBuf = new AudioTrack.SamplesBuffer(info.format, bb.pos);
dbSize = dbBuf.capacity;
bb.flip();
bb.get(dbBuf, 0, dbBuf.count);
bb.get(dbBuf, 0, dbBuf.capacity);
} else {
dbBuf = buffer;
dbSize = readSize;