diff --git a/stream/flac/decode.go b/stream/flac/decode.go index 941610e2..6c8445e4 100644 --- a/stream/flac/decode.go +++ b/stream/flac/decode.go @@ -25,8 +25,6 @@ func Decode(buf []byte) ([]byte, error) { enc := wav.NewEncoder(ws, int(stream.Info.SampleRate), int(stream.Info.BitsPerSample), int(stream.Info.NChannels), wavAudioFormat) defer enc.Close() var data []int - var out []byte - var d []byte for { // Decode FLAC audio samples. frame, err := stream.ParseNext() @@ -55,12 +53,10 @@ func Decode(buf []byte) ([]byte, error) { if err := enc.Write(buf); err != nil { return nil, err } - d, err = ioutil.ReadAll(ws.Reader()) - if err != nil { - return nil, err - } - out = append(out, d...) } - + d, err := ioutil.ReadAll(ws.Reader()) + if err != nil { + return nil, err + } return d, nil }