}
```
+Note regarding Forward Error Correction (FEC):
+> When a packet is considered "lost", `DecodeFEC` and `DecodeFECFloat32` methods
+> can be called on the next packet in order to try and recover some of the lost
+> data. The PCM needs to be exactly the duration of audio that is missing.
+> `LastPacketDuration()` can be used on the decoder to get the length of the
+> last packet.
+> Note also that in order to use this feature the encoder needs to be configured
+> with `SetInBandFEC(true)` and `SetPacketLossPerc(x)` options.
+
### Streams (and files)
To decode a .opus file (or .ogg with Opus data), or to decode a "Opus stream"
}
// DecodeFEC encoded Opus data into the supplied buffer with forward error
-// correction. The supplied buffer will be entirely filled.
+// correction. It is to be used on the packet directly following the lost one.
+// The supplied buffer needs to be exactly the duration of audio that is missing
func (dec *Decoder) DecodeFEC(data []byte, pcm []int16) error {
if dec.p == nil {
return errDecUninitialized
}
// DecodeFECFloat32 encoded Opus data into the supplied buffer with forward error
-// correction. The supplied buffer will be entirely filled.
+// correction. It is to be used on the packet directly following the lost one.
+// The supplied buffer needs to be exactly the duration of audio that is missing
func (dec *Decoder) DecodeFECFloat32(data []byte, pcm []float32) error {
if dec.p == nil {
return errDecUninitialized