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

'volume' argument in ff_opts not working #145

Open
mak8kammerer opened this issue May 20, 2023 · 1 comment
Open

'volume' argument in ff_opts not working #145

mak8kammerer opened this issue May 20, 2023 · 1 comment

Comments

@mak8kammerer
Copy link

Hello everyone! I am trying write a simple audio player using MediaPlayer class. Here is my code:

from ffpyplayer.player import MediaPlayer
player = MediaPlayer('audio.mp3', ff_opts={'volume': 0})
while True:
    pass

The sound is playing, but the volume is not 0!
This command work perfectly: ffplay -af "volume=0.0" audio.mp3
Some additional info:

  • Python: 3.9.5
  • OS: Windows 10 Pro
  • Installation metod: pip
  • ffpyplayer version: 4.5.0
@mak8kammerer
Copy link
Author

The problem was solved by manual compilation on the computer. I downloaded the source code of the ffpyplayer, then downloaded the SDL2 and ffmpeg (from here; the archive name looked like this: ffmpeg-n6.0-latest-win64-gpl-shared-6.0.zip) binaries. Then I unpacked the archive and added the paths to them in the environment variables at the top of setup.py (FFMPEG_ROOT and SDL_ROOT).

In the SDL2 folder there is a lib folder with two folders x64 and x86. You need to transfer the contents of the folder with the architecture of your processor (for example: x64) to the lib folder.

Compilation is done with the command: python setup.py build_ext

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

No branches or pull requests

1 participant