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

libsndfile error handling #5

Open
FabricioS opened this issue Mar 20, 2011 · 1 comment
Open

libsndfile error handling #5

FabricioS opened this issue Mar 20, 2011 · 1 comment

Comments

@FabricioS
Copy link

Hi David,
using audiolab for a few years, I looked to the TODO list (in the docs) to see if I could help somehow. You wrote one of the next goal is to «support the libsndfile’s error system».

If i understand http://www.mega-nerd.com/libsndfile/api.html#error , each call to functions sf_xxx taking a SndFile pointer as input is able to store a error code in this structure (less sf_open and sf_open_fd that return a NULL pointer in case of failed opening of file). Do you confirm that to support this error system, we need to check the error code (through the sf_error function). If non zero, next step is to invoke sf_strerror to get a description of error and raise the adequate pythonic exception.

Are you OK with that?

@FabricioS
Copy link
Author

It seems that you were kind of aware of that. I am not sure the way you used the sf_strerror on the NULL pointer (L480 in _sndfile.pyx) is the right one.
I would use it after sf_read/write (correct number of items with respect to number of channels), sf_seek and sf_get/set_string functions call.

@FabricioS FabricioS reopened this Apr 10, 2011
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