Report proper number of samples on Read

This commit is contained in:
DataHoarder 2023-01-28 15:16:46 +01:00
parent 9103da68c3
commit 872fc94825
Signed by: DataHoarder
SSH key fingerprint: SHA256:OLTRf6Fl87G52SiR7sWLGNzlJt4WOX+tfI2yxo0z7xk

View file

@ -67,7 +67,7 @@ func (d *Decoder) Read(p []float32) (int, error) {
// If there is any data left in the pcm buffer, then move it to the beginning of the buffer
copy(d.pcm, d.pcm[n:d.pcmLength/C.sizeof_float])
d.pcmLength -= n * C.sizeof_float
return n / C.sizeof_float, nil
return n, nil
}
// Seek sets a new position for reading audio data.