lugia19 / elevenlabslib

Full python wrapper for the elevenlabs API.
MIT License
150 stars 27 forks source link

libsndfile needs to be over version 1.1.0 for this library to work, stream. #7

Closed juankysoriano closed 1 year ago

juankysoriano commented 1 year ago

The stream method would only work if the version of the libsndfile C library installed on the device is over 1.1.0 (where they introduced support for MP3). As the change was done on libsndfile is "pretty recent" it's very likely a lot of long-term-support OS hasn't migrated yet to that version, and therefore it would make the library unusable for those users.

Given how this is implemented atm (this library basically swallows all the related sndfile exceptions inside the generate_stream method) the error is pretty obscure. It took me a couple of hours of debugging.

Nothing to do on your side @lugia19 , but I believe a note about this on the README.md (the installed libsndfile needs to be over 1.1.0) would be super good for people wanting to use this library (And I believe this library is super useful so I'd expect that a lot of people will use it on the future if the elevanlabs product continues growing on popularity).

Regards.

lugia19 commented 1 year ago

Good to know. I'll make a note of it on the README, and expose more of the exceptions.

Do you happen to know an OS/distro that's currently using an older version of libsdnfile, so I can check for this exception and properly inform the user?

juankysoriano commented 1 year ago

On my case, because the project I am building runs on raspberry, it happens on the latest raspberry pi OS version. Based on Debian 11, bullseye

While on my macbook it was working out of the box, on raspberry it took me hours of debugging and finally once I updated the libsnd it was working as a charm.

Doing a bit of research it looks like the latest Ubuntu LTS; 22.04 would also be affected as it includes libsndfile 1.0.3 or something like that

lugia19 commented 1 year ago

Yes, I didn't notice this was an issue as on windows/macOS the soundfile module automatically installs the most recent libsdnfile version. A note should be good enough then.

EDIT: Actually, it also won't be an issue on most linux installs, as a new version of libsoundfile is also installed on 64-bit Linux. So yes, a note should suffice.