By default is seems to queue. My TimerFcn updates the XData of a line in axes, and (when system busy) I see it move after the playback is complete. I would like to set the busy action to cancel/drop.
audioplayer TimerFcn behavior when busy
2 次查看(过去 30 天)
显示 更早的评论
Hello there. Does an audioplayer object have an option to cancel calls of TimerFcn when system busy ?
(Like "BusyAction" for graphic objects or "BusyMode" for timer objects)
5 个评论
Mario Malic
2023-2-24
编辑:Mario Malic
2023-2-24
One thing that may be possible, however I am not sure how it would affect the performance of the compiled app. When you use plot, you add line objects, instead you could alter the XData and the YData of the first plotted line object. Example is below
function PlotDataAvailable(src, event)
[data, timestamps, ~] = read(src, src.ScansAvailableFcnCount, "OutputFormat", "Matrix");
persistent init fig ax hPlot;
if isempty(init)
init = true;
fig = figure();
ax = axes(fig);
end
if isempty(hPlot)
hPlot = plot(ax, timestamps, data);
else
hold(ax, "on");
set(hPlot, "XData", [hPlot.XData, timestamps'], "YData", [hPlot.YData, data'])
end
end
Otherwise, you should find a way to debug the compiled application, and figure out why does it happen.
采纳的回答
Guillaume
2023-3-15
3 个评论
Mario Malic
2023-3-15
Use diary to save the output of the command windows to a file. Output the needed data to the command window.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!