{"action":"opened","issue":{"url":"https://api.github.com/repos/nayuki/FLAC-library-Java/issues/3","repository_url":"https://api.github.com/repos/nayuki/FLAC-library-Java","labels_url":"https://api.github.com/repos/nayuki/FLAC-library-Java/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/nayuki/FLAC-library-Java/issues/3/comments","events_url":"https://api.github.com/repos/nayuki/FLAC-library-Java/issues/3/events","html_url":"https://github.com/nayuki/FLAC-library-Java/issues/3","id":342303685,"node_id":"MDU6SXNzdWUzNDIzMDM2ODU=","number":3,"title":"Using the FlacEncoder class to encode a PCM byte array to a FLAC file","user":{"login":"nanoandrew4","id":14365320,"node_id":"MDQ6VXNlcjE0MzY1MzIw","avatar_url":"https://avatars2.githubusercontent.com/u/14365320?v=4","gravatar_id":"","url":"https://api.github.com/users/nanoandrew4","html_url":"https://github.com/nanoandrew4","followers_url":"https://api.github.com/users/nanoandrew4/followers","following_url":"https://api.github.com/users/nanoandrew4/following{/other_user}","gists_url":"https://api.github.com/users/nanoandrew4/gists{/gist_id}","starred_url":"https://api.github.com/users/nanoandrew4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nanoandrew4/subscriptions","organizations_url":"https://api.github.com/users/nanoandrew4/orgs","repos_url":"https://api.github.com/users/nanoandrew4/repos","events_url":"https://api.github.com/users/nanoandrew4/events{/privacy}","received_events_url":"https://api.github.com/users/nanoandrew4/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-18T12:18:46Z","updated_at":"2018-07-18T12:18:46Z","closed_at":null,"author_association":"NONE","body":"Good day:\r\n\r\nI've been working on adding FLAC support to one of my programs, and I thought it'd be great to use your project, since it has an encoder and decoder. However, I cannot figure out how the encoder works. No matter how I try to arrange my sample data, it always throws an IllegalArgumentException once it reaches the computeBest() method. It probably has to do with how I'm converting the PCM data to the format that the FlacEncoder requires (an int[][]). \r\n\r\nCould you explain how that 2D int array should be constructed to work? I tried putting a sample in each array position, with index 0 being the left channel, and index 1 being the right channel, and that did not work. In essence, something like: samples[0][0] = leftChannelByte; samples[0][1] = rightChannelByte; etc...\r\n\r\nI also tried flipping the use of indices in the array, so making the first dimension the number of channels, and the second the length of the PCM array divided by the number of channels (the opposite of what I outlined above), and that also failed.\r\n\r\nIn case it is relevant, I am using 2 channels, sample rate of 44100, block size of 4096 and SUBSET_BEST for search options.\r\n\r\nThank you."}}
{"actor":{"display_login":"nanoandrew4"}}