Problem with playing audio file from App Designer

4 vues (au cours des 30 derniers jours)
Temirkhan Amanzhanov
Temirkhan Amanzhanov le 1 Juin 2020
Hello everyone, I have a problem with playing audio file in App Designer. I have no idea how to solve it. Before today everything was working, but suddenly it has been changed. The error massage: "Error using audioplayer Too many input arguments." Thanks for response! There is my code:
classdef AudioPlayer191 < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
MainmenuMenu matlab.ui.container.Menu
OpenafileMenu matlab.ui.container.Menu
EqualizerMenu matlab.ui.container.Menu
PreferencesMenu matlab.ui.container.Menu
Switch matlab.ui.control.Switch
Panel matlab.ui.container.Panel
Previous matlab.ui.control.Button
Stop matlab.ui.control.Button
Slider matlab.ui.control.Slider
Play matlab.ui.control.Button
VolumeFull matlab.ui.control.Button
CurrentSong matlab.ui.control.EditField
Next matlab.ui.control.Button
PlayList matlab.ui.control.EditField
UIAxes matlab.ui.control.UIAxes
ScrollerTrack matlab.ui.control.Slider
Timer matlab.ui.control.EditField
Label matlab.ui.control.Label
end
properties (Access = private)
player
filename
pathname
y
flag
end
properties (Access = public)
vol
end
% Callbacks that handle component events
methods (Access = private)
% Menu selected function: OpenafileMenu
function OpenafileMenuSelected(app, event)
[app.filename, app.pathname] = uigetfile("*.mp3; *.wav; *.m4a; *.flac; *.aac", "Choose a file");
app.CurrentSong.Value = fullfile(app.pathname, app.filename);
[app.y, Fs] = audioread(app.CurrentSong.Value);
app.player = audioplayer(app.y, Fs);

Réponse acceptée

Ameer Hamza
Ameer Hamza le 2 Juin 2020
I think you have named your own app "audioplayer". You can check it using
which audioplayer
If it shows the path your .mlapp file, then rename it.

Plus de réponses (0)

Produits


Version

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by