Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for pcm generated by mpg123 not ending on a sample interval #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

WilliamWCYoung
Copy link

This is a fix to address PCM data being passed in that doesn't match the sample frame length. I encounted this while using mpg123 with the error:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/***/mumble.py", line 108, in run
    self.loop()
  File "/***/mumble.py", line 170, in loop
    self.sound_output.send_audio()  # send outgoing audio if available
  File "/***/soundoutput.py", line 73, in send_audio
    encoded = self.encoder.encode(to_encode)
  File "/***/pyopus/opus.py", line 47, in encode
    return self.encoder.encode(pcm, len(pcm))
  File "copus.pyx", line 50, in copus.OpusEncoder.encode (copus.c:1324)
SystemError: Negative size passed to PyString_FromStringAndSize

Tested on Arch Linux x86_64, may be that this is actually intended behaviour and it is required to pass in 'cleaned' PCM.

@raylu
Copy link

raylu commented Jan 6, 2016

it looks like the patch mixes hard and soft tabs

@WilliamWCYoung
Copy link
Author

As much as I won't blame my tools, going from sublime to gedit fooled me! Amended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants