zackees / zcmds

Swiss army knife of insanely productive CLI and AI tools. Cross platform.
MIT License
27 stars 5 forks source link

ValueError: rate must be specified when data is a numpy array or list of audio samples #9

Closed sugizo closed 2 months ago

sugizo commented 2 months ago

execute !vid2mp3 -o 'vid2mp3.mp3' -n 'ForBiggerBlazes.mp4'

result


-o does not exist
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
[<ipython-input-83-be798a73c399>](https://localhost:8080/#) in <cell line: 3>()
      1 get_ipython().system("vid2mp3 -o 'vid2mp3.mp3' -n 'ForBiggerBlazes.mp4'")
      2 
----> 3 Audio('vid2mp3.mp3')

[/usr/local/lib/python3.10/dist-packages/IPython/lib/display.py](https://localhost:8080/#) in __init__(self, data, filename, url, embed, rate, autoplay, normalize, element_id)
    114         if self.data is not None and not isinstance(self.data, bytes):
    115             if rate is None:
--> 116                 raise ValueError("rate must be specified when data is a numpy array or list of audio samples.")
    117             self.data = Audio._make_wav(data, rate, normalize)
    118 

ValueError: rate must be specified when data is a numpy array or list of audio samples.```
zackees commented 2 months ago

Please provide an example that I can use to reproduce the issue. Thanks.

sugizo commented 2 months ago

mp4 file wget -c http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4

execute got the same result, but the ffmpeg process is shown, the first posted not shown ffmpeg process !vid2mp3 'ForBiggerBlazes.mp4' -o 'vid2mp3.mp3' -n

info

zackees commented 2 months ago

Thanks for the repro case. I was able to reproduce the issue on the command line and issue a fix. Please run an update to get it:

pip install -U zcmds