Skip to content

Conversation

LinuxEclipsed
Copy link

This module is needed for --tts=piper.

This module is needed for tts=piper.
@p0n1
Copy link
Owner

p0n1 commented Mar 27, 2025

Thanks for bringing this up. Is the audioop-lts actually this https://github.com/AbstractUmbra/audioop? It looks like only support python version >= 3.13, right?

I haven't played with piper for a while. I have trouble in installing piper on my machine. Check https://github.com/p0n1/epub_to_audiobook?tab=readme-ov-file#piper-tts. So this project didn't include the piper package. I leave it for users to install manually.

@LinuxEclipsed
Copy link
Author

LinuxEclipsed commented Mar 27, 2025

Hello!

I should have provided more information on the initial pull request.

OS: Fedora 41
Python: 3.13.1
Piper: 1.2.0 <-- Installed from binary
audioop-lts: 0.2.1

I followed the installation section of the README.md to get started. After running the following command Python produced errors, which searches lead me to AbstractUmbra/audioop-lts. I did a pip install audioop-lts, and it resolved the error. I searched for ModuleNotFoundError: No module named 'pyaudioop'

Note: Piper was installed via git clone directly using the binary and not pip install piper-tts as noted in the troubleshooting section of the README.

Command
python3 main.py <myepub>.epub ./mybook --tts=piper --piper_path=../piper/piper --model=../piper/en_US-john-medium.onnx

Full Error:

epub_to_audiobook/venv/lib64/python3.13/site-packages/ebooklib/epub.py:1423: FutureWarning: This search incorrectly ignores the root element, and will be fixed in a future version.  If you rely on the current behaviour, change it to './/xmlns:rootfile[@media-type]'
  for root_file in tree.findall('//xmlns:rootfile[@media-type]', namespaces={'xmlns': NAMESPACES['CONTAINERNS']}):
Traceback (most recent call last):
  File "/home/kory/epub_to_audiobook/venv/lib64/python3.13/site-packages/pydub/utils.py", line 14, in <module>
    import audioop
ModuleNotFoundError: No module named 'audioop'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/kory/epub_to_audiobook/main.py", line 189, in <module>
    main()
    ~~~~^^
  File "/home/kory/epub_to_audiobook/main.py", line 185, in main
    AudiobookGenerator(config).run()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/home/kory/epub_to_audiobook/audiobook_generator/core/audiobook_generator.py", line 37, in run
    tts_provider = get_tts_provider(self.config)
  File "/home/kory/epub_to_audiobook/audiobook_generator/tts_providers/base_tts_provider.py", line 60, in get_tts_provider
    from audiobook_generator.tts_providers.piper_tts_provider import (
        PiperTTSProvider,
    )
  File "/home/kory/epub_to_audiobook/audiobook_generator/tts_providers/piper_tts_provider.py", line 6, in <module>
    from pydub import AudioSegment
  File "/home/kory/epub_to_audiobook/venv/lib64/python3.13/site-packages/pydub/__init__.py", line 1, in <module>
    from .audio_segment import AudioSegment
  File "/home/kory/epub_to_audiobook/venv/lib64/python3.13/site-packages/pydub/audio_segment.py", line 11, in <module>
    from .utils import mediainfo_json, fsdecode
  File "/home/kory/epub_to_audiobook/venv/lib64/python3.13/site-packages/pydub/utils.py", line 16, in <module>
    import pyaudioop as audioop
ModuleNotFoundError: No module named 'pyaudioop'

requirements.txt Outdated
@@ -8,3 +8,4 @@ edge-tts==6.1.12
pydub==0.25.1
wyoming==1.6.0
httpx==0.27.2
audioop-lts
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to specify specific version to lock it

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I modified the commit to reflect the correct version.
audioop-lts==0.2.1

Copy link
Collaborator

@Bryksin Bryksin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@p0n1 merge if you are ok with it

@DanWin
Copy link

DanWin commented May 8, 2025

After upgrading Ubuntu to the latest version, which brings python 3.13, Edge TTS failed with ModuleNotFoundError: No module named 'audioop'. Applying this change fixed it.

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.

4 participants