sofacoustics / SOFAtoolbox

SOFA Toolbox (API for Matlab, Octave)
http://sofaconventions.org
European Union Public License 1.2
116 stars 31 forks source link

Listening to HRTF not working #33

Closed fewege closed 2 years ago

fewege commented 3 years ago

I want to test a sofa file by listening to a test audio file through it.

For this I'm using the given code of the README.md. But I always get the following error:

Error using conv (line 28) A and B must be vectors.

The code I used was the following:

>> apparentSourceVector(91, 1)
SOFAplotGeometry(hrtf, 91);
soundInput = audioread(wav);
soundOutput = [conv(squeeze(hrtf.Data.IR(91, 1, :)), soundInput) ...    
               conv(squeeze(hrtf.Data.IR(91, 2, :)), soundInput)];
sound(soundOutput, hrtf.Data.SamplingRate);

I tried several sofa-files, but this always comes up.

PS: If you've got any tips how I could test my file in a nother way, I'd be glad to get some input.

HaHeho commented 3 years ago

The problem seems to be that conv() expects data in a different format, as indicated by the error message. Investigate both inputs more closely and check in the documentation what conv() expects. Maybe the problem is just a missing transpose?

isfmiho commented 2 years ago

Hi, is this issue still open or can I close the topic?

isfmiho commented 2 years ago

I updated and checked the example of the README.md. It should be working now.