The source code for the playaudio function is very straightforward:
if (any (strcmp (ext, {"lin", "raw"})))
[status, out] = system (sprintf ('cat "%s" > /dev/dsp', name));
if (status != 0)
system (sprintf ('paplay --raw "%s"', name));
endif
elseif (any (strcmp (ext, {"mu", "au" "snd", "ul"})))
[status, out] = system (sprintf ('cat "%s" > /dev/audio', name));
if (status != 0)
system (sprintf ('paplay "%s"', name));
endif
else
error ("playaudio: unsupported extension '%s'", ext);
endif
As you can see, it's simply doing a system call with the paplay utility available in all Linux systems using the PulseAudio sound server. If you have the permission to edit the playaudio.m file yourself, just add the "wav" extension to the list as in:
elseif (any (strcmp (ext, {"mu", "au" "snd", "ul", "wav"})))
It should work out of the box.
I'll submit this patch to the GNU Octave bug tracking system. Thanks for reporting the issue.
Patch submitted: https://savannah.gnu.org/patch/index.php?8441
wavreadfirst. - Schorsch