Skip to content

Commit

Permalink
cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
LabyStudio committed Jul 30, 2022
1 parent 1217ca8 commit 1d72868
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions opus-jni-java/src/main/java/net/labymod/opus/OpusCodec.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public byte[] encodeFrame(byte[] bytes) {
* throws {@link IllegalArgumentException} if length is invalid
*/
public byte[] encodeFrame(byte[] bytes, int offset, int length) {
if (length != getChannels() * getFrameSize() * 2)
throw new IllegalArgumentException(String.format("data length must be == CHANNELS * FRAMESIZE * 2 (%d bytes) but is %d bytes", getChannels() * getFrameSize() * 2, bytes.length));
if (length != this.getChannels() * this.getFrameSize() * 2)
throw new IllegalArgumentException(String.format("data length must be == CHANNELS * FRAMESIZE * 2 (%d bytes) but is %d bytes", this.getChannels() * this.getFrameSize() * 2, bytes.length));
this.ensureEncoderExistence();
return this.encodeFrame(this.encoderState, bytes, offset, length);
}
Expand Down Expand Up @@ -217,7 +217,7 @@ public Builder withMaxPacketSize(int maxPacketSize) {
}

public OpusCodec build() {
return new OpusCodec(OpusCodecOptions.of(frameSize, sampleRate, channels, bitrate, maxFrameSize, maxPacketSize));
return new OpusCodec(OpusCodecOptions.of(this.frameSize, this.sampleRate, this.channels, this.bitrate, this.maxFrameSize, this.maxPacketSize));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,27 @@ private OpusCodecOptions(int frameSize, int sampleRate, int channels, int bitrat
}

public int getFrameSize() {
return frameSize;
return this.frameSize;
}

public int getSampleRate() {
return sampleRate;
return this.sampleRate;
}

public int getChannels() {
return channels;
return this.channels;
}

public int getBitrate() {
return bitrate;
return this.bitrate;
}

public int getMaxFrameSize() {
return maxFrameSize;
return this.maxFrameSize;
}

public int getMaxPacketSize() {
return maxPacketSize;
return this.maxPacketSize;
}

protected static OpusCodecOptions of(int frameSize, int sampleRate, int channels, int bitrate, int maxFrameSize, int maxPacketSize) {
Expand Down

0 comments on commit 1d72868

Please sign in to comment.