sdp交换存在问题
This commit is contained in:
@@ -71,7 +71,6 @@ func (w *PCMStreamDriver) AudioRecord(p prop.Media) (audio.Reader, error) {
|
||||
case <-w.closed:
|
||||
return nil, func() {}, io.EOF
|
||||
case pcmData, ok := <-w.PCM:
|
||||
logrus.Debug("got %d bytes pcm data", len(pcmData))
|
||||
if !ok {
|
||||
return nil, func() {}, io.ErrClosedPipe
|
||||
}
|
||||
@@ -85,7 +84,7 @@ func (w *PCMStreamDriver) AudioRecord(p prop.Media) (audio.Reader, error) {
|
||||
func bytesTo16BitSamples(b []byte) []int16 {
|
||||
samples := make([]int16, 0)
|
||||
for i := 0; i < len(b); i += 2 {
|
||||
sample := binary.LittleEndian.Uint16(b[i : i+1])
|
||||
sample := binary.LittleEndian.Uint16(b[i : i+2])
|
||||
samples = append(samples, int16(sample))
|
||||
}
|
||||
return samples
|
||||
|
Reference in New Issue
Block a user