forked from google/ExoPlayer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generalize SonicAudioProcessor in AudioTrack into a PSTSAudioProcesso…
…r. A custom audio processor that does pitch-shifting and time stretching needs to be passed as the LAST AudioProcessor to a MediaCodecAudioRenderer / AudioTrack for it to replace the default Sonic implementation.
- Loading branch information
Showing
3 changed files
with
68 additions
and
13 deletions.
There are no files selected for viewing
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
31 changes: 31 additions & 0 deletions
31
library/core/src/main/java/com/google/android/exoplayer2/audio/PSTSAudioProcessor.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,31 @@ | ||
package com.google.android.exoplayer2.audio; | ||
|
||
|
||
public interface PSTSAudioProcessor extends AudioProcessor { | ||
|
||
/** | ||
* Sets the playback pitch. The new pitch will take effect after a call to {@link #flush()}. | ||
* | ||
* @param pitch The requested new pitch. | ||
* @return The actual new pitch. | ||
*/ | ||
float setPitch(float pitch); | ||
|
||
/** | ||
* Sets the playback speed. The new speed will take effect after a call to {@link #flush()}. | ||
* | ||
* @param speed The requested new playback speed. | ||
* @return The actual new playback speed. | ||
*/ | ||
float setSpeed(float speed); | ||
|
||
/** | ||
* Returns the number of bytes of input queued since the last call to {@link #flush()}. | ||
*/ | ||
long getInputByteCount(); | ||
|
||
/** | ||
* Returns the number of bytes of output dequeued since the last call to {@link #flush()}. | ||
*/ | ||
long getOutputByteCount(); | ||
} |
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