{"action":"opened","issue":{"url":"https://api.github.com/repos/asantoni/libaudiodecoder/issues/3","repository_url":"https://api.github.com/repos/asantoni/libaudiodecoder","labels_url":"https://api.github.com/repos/asantoni/libaudiodecoder/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/asantoni/libaudiodecoder/issues/3/comments","events_url":"https://api.github.com/repos/asantoni/libaudiodecoder/issues/3/events","html_url":"https://github.com/asantoni/libaudiodecoder/issues/3","id":159745373,"number":3,"title":"What is the correct way create a custom output buffer?","user":{"login":"ApothemBill","id":18452146,"avatar_url":"https://avatars.githubusercontent.com/u/18452146?v=3","gravatar_id":"","url":"https://api.github.com/users/ApothemBill","html_url":"https://github.com/ApothemBill","followers_url":"https://api.github.com/users/ApothemBill/followers","following_url":"https://api.github.com/users/ApothemBill/following{/other_user}","gists_url":"https://api.github.com/users/ApothemBill/gists{/gist_id}","starred_url":"https://api.github.com/users/ApothemBill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ApothemBill/subscriptions","organizations_url":"https://api.github.com/users/ApothemBill/orgs","repos_url":"https://api.github.com/users/ApothemBill/repos","events_url":"https://api.github.com/users/ApothemBill/events{/privacy}","received_events_url":"https://api.github.com/users/ApothemBill/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-11T00:18:41Z","updated_at":"2016-06-11T00:18:41Z","closed_at":null,"body":"I followed the playsong example and got libaudiodecoder working in my own project. However, I want to decode the entire audio file at once and store it in memory instead of decoding during the audio callback function in PortAudio. It's unclear what the correct way to do this is. I assumed that it was this:\r\n```\r\nfloat* output = new float[audioDecoder->numSamples()];\r\n\r\nint samplesRead = audioDecoder->read(audioDecoder->numSamples(), output);\r\n\r\n// since this is just a test to make sure it's working,\r\n// free the output buffer to avoid a memory leak\r\ndelete[] output;\r\n```\r\nBut that gave me this error:\r\n```\r\nAssertion failed!\r\n\r\nFile: src\\audiodecodermediafoundation.cpp\r\nLine: 220\r\n\r\nExpression: size < sizeof(m_destBufferShort)\r\n\r\nFor information on how your program can cause an assertion\r\nfailure, see the Visual C++ documentation on asserts\r\n```\r\nSo how am I supposed to create a custom output buffer?"}}
{"actor":{"display_login":"ApothemBill"}}