{"action":"created","issue":{"url":"https://api.github.com/repos/TWOEARS/binaural-simulator/issues/8","repository_url":"https://api.github.com/repos/TWOEARS/binaural-simulator","labels_url":"https://api.github.com/repos/TWOEARS/binaural-simulator/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/TWOEARS/binaural-simulator/issues/8/comments","events_url":"https://api.github.com/repos/TWOEARS/binaural-simulator/issues/8/events","html_url":"https://github.com/TWOEARS/binaural-simulator/issues/8","id":138441080,"number":8,"title":"saveFile fils with empty signal","user":{"login":"hagenw","id":173624,"avatar_url":"https://avatars.githubusercontent.com/u/173624?v=3","gravatar_id":"","url":"https://api.github.com/users/hagenw","html_url":"https://github.com/hagenw","followers_url":"https://api.github.com/users/hagenw/followers","following_url":"https://api.github.com/users/hagenw/following{/other_user}","gists_url":"https://api.github.com/users/hagenw/gists{/gist_id}","starred_url":"https://api.github.com/users/hagenw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hagenw/subscriptions","organizations_url":"https://api.github.com/users/hagenw/orgs","repos_url":"https://api.github.com/users/hagenw/repos","events_url":"https://api.github.com/users/hagenw/events{/privacy}","received_events_url":"https://api.github.com/users/hagenw/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/TWOEARS/binaural-simulator/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"fietew","id":7665585,"avatar_url":"https://avatars.githubusercontent.com/u/7665585?v=3","gravatar_id":"","url":"https://api.github.com/users/fietew","html_url":"https://github.com/fietew","followers_url":"https://api.github.com/users/fietew/followers","following_url":"https://api.github.com/users/fietew/following{/other_user}","gists_url":"https://api.github.com/users/fietew/gists{/gist_id}","starred_url":"https://api.github.com/users/fietew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fietew/subscriptions","organizations_url":"https://api.github.com/users/fietew/orgs","repos_url":"https://api.github.com/users/fietew/repos","events_url":"https://api.github.com/users/fietew/events{/privacy}","received_events_url":"https://api.github.com/users/fietew/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2016-03-04T10:38:02Z","updated_at":"2016-03-04T12:50:13Z","closed_at":null,"body":"I was testing the tutorial example:\r\nhttp://twoears.aipa.tu-berlin.de/doc/latest/intro/tutorial-acoustic-scene/#binaural-renderer\r\n\r\nThe following commands work great:\r\n```Matlab\r\n>> sim = simulator.SimulatorConvexRoom('binaural_renderer.xml');\r\n>> sim.set('Init',true);\r\nStarting the SSR with following settings:\r\n * number of sources: 1\r\n * block_size: 4096\r\n * delayline_size: 0\r\n * hrir_file: /home/hagen/git/twoears/twoears-wp1/src/+xml/../../tmp/QU_KEMAR_anechoic_3m_tp7be417cc_52c0_4dbc_a041_f6e4b0d51c38.wav\r\n * initial_delay: 0\r\n * sample_rate: 44100\r\n * threads: 1\r\nInitialization of BinauralRenderer completed, 2 outputs available.\r\n>> signal = sim.getSignal();\r\n>> size(signal)\r\n\r\nans =\r\n\r\n      450560           2\r\n```\r\n\r\nIf I do the same with the `saveFile` function as proposed in the example it fails:\r\n```Matlab\r\n>> sim = simulator.SimulatorConvexRoom('binaural_renderer.xml');\r\n>> sim.set('Init',true);\r\nStarting the SSR with following settings:\r\n * number of sources: 1\r\n * block_size: 4096\r\n * delayline_size: 0\r\n * hrir_file: /home/hagen/git/twoears/twoears-wp1/src/+xml/../../tmp/QU_KEMAR_anechoic_3m_tpdeda73ed_5de5_46dd_bb26_2b2f6a64e547.wav\r\n * initial_delay: 0\r\n * sample_rate: 44100\r\n * threads: 1\r\nInitialization of BinauralRenderer completed, 2 outputs available.\r\n>> sim.Sinks.saveFile('binaural_renderer.wav',sim.SampleRate);  \r\nError using ./\r\nMatrix dimensions must agree.\r\n\r\nError in simulator.buffer.Data/saveFile (line 117)\r\n      audiowrite(filename, tmp./max(abs(tmp(:))), fs);  % normalize data\r\n```\r\n\r\nIf you debug, you will find that `size(tmp)` is `[0 0]`."},"comment":{"url":"https://api.github.com/repos/TWOEARS/binaural-simulator/issues/comments/192269155","html_url":"https://github.com/TWOEARS/binaural-simulator/issues/8#issuecomment-192269155","issue_url":"https://api.github.com/repos/TWOEARS/binaural-simulator/issues/8","id":192269155,"user":{"login":"fietew","id":7665585,"avatar_url":"https://avatars.githubusercontent.com/u/7665585?v=3","gravatar_id":"","url":"https://api.github.com/users/fietew","html_url":"https://github.com/fietew","followers_url":"https://api.github.com/users/fietew/followers","following_url":"https://api.github.com/users/fietew/following{/other_user}","gists_url":"https://api.github.com/users/fietew/gists{/gist_id}","starred_url":"https://api.github.com/users/fietew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fietew/subscriptions","organizations_url":"https://api.github.com/users/fietew/orgs","repos_url":"https://api.github.com/users/fietew/repos","events_url":"https://api.github.com/users/fietew/events{/privacy}","received_events_url":"https://api.github.com/users/fietew/received_events","type":"User","site_admin":false},"created_at":"2016-03-04T12:50:13Z","updated_at":"2016-03-04T12:50:13Z","body":"1. You are not doing the same: ``sim.getSignal()`` processes the binaural signal, while in the second code snippets the simulator is just initialized and does nothing afterwards. Hence, the buffer of the sink is empty.\r\n2. Yes, an empty buffer should be handled somehow in ``.saveFile`` in order to give a more meaningful error message "}}