The AMBEFrame object is created twice, and hence fully processed twice. Rather than creating the AMBEFrame object and passing its reference down the line.
The get audio method used here takes frame data and creates a new AMBEFrame. However an instance of AMBEFrame is created just before this and can be passed it getAudio instead.
|
AudioWithMetadata audioWithMetadata = AudioWithMetadata.create(getAudio(frameData)); |
Another getAudio method is available that already takes an AMBEFrame object. This way the frame is not decoded, error corrected, and processed twice.
The AMBEFrame object is created twice, and hence fully processed twice. Rather than creating the AMBEFrame object and passing its reference down the line.
The get audio method used here takes frame data and creates a new AMBEFrame. However an instance of AMBEFrame is created just before this and can be passed it getAudio instead.
jmbe/codec/src/main/java/jmbe/codec/ambe/AMBEAudioCodec.java
Line 72 in 4e9a295
Another getAudio method is available that already takes an AMBEFrame object. This way the frame is not decoded, error corrected, and processed twice.