'volume' argument in ff_opts not working
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
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