{"action":"created","issue":{"url":"https://api.github.com/repos/bastibe/PySoundFile/issues/132","labels_url":"https://api.github.com/repos/bastibe/PySoundFile/issues/132/labels{/name}","comments_url":"https://api.github.com/repos/bastibe/PySoundFile/issues/132/comments","events_url":"https://api.github.com/repos/bastibe/PySoundFile/issues/132/events","html_url":"https://github.com/bastibe/PySoundFile/issues/132","id":71816907,"number":132,"title":"Change order of arguments in soundfile.write()","user":{"login":"mgeier","id":705404,"avatar_url":"https://avatars.githubusercontent.com/u/705404?v=3","gravatar_id":"","url":"https://api.github.com/users/mgeier","html_url":"https://github.com/mgeier","followers_url":"https://api.github.com/users/mgeier/followers","following_url":"https://api.github.com/users/mgeier/following{/other_user}","gists_url":"https://api.github.com/users/mgeier/gists{/gist_id}","starred_url":"https://api.github.com/users/mgeier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgeier/subscriptions","organizations_url":"https://api.github.com/users/mgeier/orgs","repos_url":"https://api.github.com/users/mgeier/repos","events_url":"https://api.github.com/users/mgeier/events{/privacy}","received_events_url":"https://api.github.com/users/mgeier/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/bastibe/PySoundFile/milestones/8","html_url":"https://github.com/bastibe/PySoundFile/milestones/0.8.0","labels_url":"https://api.github.com/repos/bastibe/PySoundFile/milestones/8/labels","id":1097053,"number":8,"title":"0.8.0","description":"","creator":{"login":"mgeier","id":705404,"avatar_url":"https://avatars.githubusercontent.com/u/705404?v=3","gravatar_id":"","url":"https://api.github.com/users/mgeier","html_url":"https://github.com/mgeier","followers_url":"https://api.github.com/users/mgeier/followers","following_url":"https://api.github.com/users/mgeier/following{/other_user}","gists_url":"https://api.github.com/users/mgeier/gists{/gist_id}","starred_url":"https://api.github.com/users/mgeier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgeier/subscriptions","organizations_url":"https://api.github.com/users/mgeier/orgs","repos_url":"https://api.github.com/users/mgeier/repos","events_url":"https://api.github.com/users/mgeier/events{/privacy}","received_events_url":"https://api.github.com/users/mgeier/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":0,"state":"open","created_at":"2015-05-05T14:55:01Z","updated_at":"2015-05-05T15:00:02Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-04-29T08:45:12Z","updated_at":"2015-05-05T15:00:54Z","closed_at":null,"body":"We had some discussions in the past about argument ordering (#54, #78), but I don't think we really talked about the order of the filename and the array argument in `soundfile.write()`.\r\n\r\nI always thought it would make sense to write the array first and the filename later.\r\nI would ask \"What?\" first, before I want to know \"Where?\".\r\nIt also makes some kind of sense if you think about the array as an \"input\" argument and the filename as an \"output\" argument. I'd normally mention the input arguments before the output arguments.\r\n\r\nHowever, while I'm using the function, I come to think more and more that the order actually seems strange.\r\nWhat bugged me in the beginning, is that the array and its sample rate (which belong together), are actually separated in the call (and the sample rate is obligatory!):\r\n\r\n```Python\r\nsf.write(data, 'my_audio_file.wav', fs)\r\n```\r\n\r\nThen I looked around and found that it's actually quite common to mention the file name first, e.g.:\r\nhttp://docs.scipy.org/doc/numpy/reference/generated/numpy.savetxt.html\r\nhttp://docs.scipy.org/doc/numpy/reference/generated/numpy.save.html\r\nhttp://docs.scipy.org/doc/scipy/reference/generated/scipy.io.wavfile.write.html#scipy.io.wavfile.write\r\nhttp://docs.scipy.org/doc/scipy/reference/generated/scipy.io.savemat.html\r\nhttp://docs.scipy.org/doc/scipy/reference/generated/scipy.io.mmwrite.html#scipy.io.mmwrite\r\n\r\nI hereby suggest that we change the order to:\r\n\r\n```Python\r\nsf.write('my_audio_file.wav', data, fs)\r\n```\r\n\r\nApart from it being the way NumPy and SciPy do it, it would also be more consistent to (and compatible to) `soundfile.read()`, where the array and the sample rate are returned right next to each other.\r\n\r\nAre there any counter-examples that mention the data to be saved before the file name?\r\nAre there any other arguments?"},"comment":{"url":"https://api.github.com/repos/bastibe/PySoundFile/issues/comments/99105697","html_url":"https://github.com/bastibe/PySoundFile/issues/132#issuecomment-99105697","issue_url":"https://api.github.com/repos/bastibe/PySoundFile/issues/132","id":99105697,"user":{"login":"mgeier","id":705404,"avatar_url":"https://avatars.githubusercontent.com/u/705404?v=3","gravatar_id":"","url":"https://api.github.com/users/mgeier","html_url":"https://github.com/mgeier","followers_url":"https://api.github.com/users/mgeier/followers","following_url":"https://api.github.com/users/mgeier/following{/other_user}","gists_url":"https://api.github.com/users/mgeier/gists{/gist_id}","starred_url":"https://api.github.com/users/mgeier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgeier/subscriptions","organizations_url":"https://api.github.com/users/mgeier/orgs","repos_url":"https://api.github.com/users/mgeier/repos","events_url":"https://api.github.com/users/mgeier/events{/privacy}","received_events_url":"https://api.github.com/users/mgeier/received_events","type":"User","site_admin":false},"created_at":"2015-05-05T15:00:54Z","updated_at":"2015-05-05T15:00:54Z","body":"Alternatively, we can just skip 0.7.1 and go directly to 0.8.0 ...?"}}