octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gsoc2013 octave audio system


From: Mike Miller
Subject: Re: gsoc2013 octave audio system
Date: Thu, 18 Apr 2013 10:38:19 -0400

On Thu, Apr 18, 2013 at 8:39 AM, Vytautas Jancauskas wrote:
> Added an audiodevinfo.cc file. It provides the following functionality:
>
> devinfo = audiodevinfo;
> devinfo.('output');
>
> will return the list of structures for each output device, 'output'
> can be substituted for 'input'. I will implement full functionality of
> matlabs audiodevinfo
> (http://www.mathworks.se/help/matlab/ref/audiodevinfo.html) to include
> as part of the GSoC proposal and leave audioplayer, audiorecorder and
> fixing the legacy functionality for the program itself if the proposal
> gets accepted.
>
> In the code above if I try to simply type devinfo in to the command
> line octave I get the following output for some reason:
>
> devinfo =
>
>   scalar structure containing the fields:
>
>     input =
>
> error: octave_base_value::print (): wrong type argument `cs-list'
>
>     output =
>
> error: octave_base_value::print (): wrong type argument `cs-list'
>
> Is the normal or am I using the wrong structure for an array of structures?

Yes, you are using the type that is mostly used for lists of function
arguments and return values. You should be using an array type
instead. You can convert the octave_value_list to an array like this:

diff --git a/src/audiodevinfo.cc b/src/audiodevinfo.cc
--- a/src/audiodevinfo.cc
+++ b/src/audiodevinfo.cc
@@ -32,8 +32,8 @@
             output.append(dinfo);
         }
     }
-    devinfo.assign("input", input);
-    devinfo.assign("output", output);
+    devinfo.assign("input", input.array_value());
+    devinfo.assign("output", output.array_value());
     return octave_value(devinfo);
 error:
     return octave_value();

-- 
mike


reply via email to

[Prev in Thread] Current Thread [Next in Thread]