matlab - How do I paste the audioinfo of a music file? -
i want able update text box audioinfo of sound file.
the current solution have gives me error
info = audioinfo('music1.mp3'); set(handles.edit1,'string',info);
running info
in console gives me information sound file , stores in workspace right of matlab. want information update textbox (edit1
).
error:
while setting 'string' property of 'uicontrol': string should char, numeric or cell array datatype.
can help?
i recommend using uitable
rather 'edit'
uicontrol
object. 'edit' uicontrol
objects can 1 line can't used anyway, , alternative, 'listbox'
can 1 column need sprintf
/fprintf
data fit.
for example:
% generate audio file load handel.mat filename = 'handel.wav'; audiowrite(filename,y,fs); clear y fs % build dummy gui f = figure('toolbar', 'none'); t = uitable('parent', f, 'units', 'normalized', 'position', [0.1 0.1 0.8 0.8]); % read data , add table info = audioinfo(filename); t.rowname = fieldnames(info); t.data = struct2cell(info);
results in following ui:
which allows manipulate data (e.g. copy, edit, etc.)
Comments
Post a Comment