Search in sources :

Example 1 with AudioAssetForUpload

use of com.waz.api.AudioAssetForUpload in project wire-android by wireapp.

the class VoiceFilterController method approveAudio.

public void approveAudio() {
    if (audioAssetForUpload == null) {
        originalRecording.applyEffect(AudioEffect.NONE, new Asset.LoadCallback<AudioAssetForUpload>() {

            @Override
            public void onLoaded(AudioAssetForUpload audioAssetForUpload) {
                VoiceFilterController.this.audioAssetForUpload = audioAssetForUpload;
                approveAudio();
            }

            @Override
            public void onLoadFailed() {
                VoiceFilterController.this.audioAssetForUpload = originalRecording;
                approveAudio();
            }
        });
        return;
    }
    AudioAssetForUpload sendAudio = audioAssetForUpload;
    /*
            Null it to make it is not deleted during tearDown()...
         */
    audioAssetForUpload = null;
    for (RecordingObserver recordingObserver : recordingObservers) {
        recordingObserver.sendRecording(sendAudio, appliedAudioEffect);
    }
}
Also used : AudioAssetForUpload(com.waz.api.AudioAssetForUpload) Asset(com.waz.api.Asset)

Aggregations

Asset (com.waz.api.Asset)1 AudioAssetForUpload (com.waz.api.AudioAssetForUpload)1