Warning: Invalid playback selection

조회 수: 5(최근 30일)
Anonym 2020년 12월 5일
답변: Shraddha Jain 2020년 12월 23일
I am working with the three primary types of filters; the low-pass filter, the high-pass filter and the band pass filter, and creating some effect-spectres of them.
I am getting a warning regarding my playback, which I do not quite know how to fix it. Pop-ups like an error. This is what the console prints:
Warning: Invalid playback selection. Playback will start at the beginning.
> In audioplayer/play (line 67)
In EffectSpectras (line 10)
And that's the code:
%'handel is a MAT-file which is shipped with MATLAB as an example
load handel;
% Volume
x = y/1; % Decrease volume
% Plays
player = audioplayer(x, Fs);
play(player,[1 (get(player, 'SampleRate')*10)]);
% Shows result
[Rows, Cols] = size(x);
Ylo = FDLowpass(x);
Ybd = FDBandpass(x);
Yhi = FDHighpass(x);
POVylo = PowerSpecFFT(Ylo);
POVybd = PowerSpecFFT(Ybd);
POVyhi = PowerSpecFFT(Yhi);
plot(1:Rows, POVylo)
title('The low-pass')
hold on
plot(1:Rows, POVybd)
title('The band-pass')
hold on
plot(1:Rows, POVyhi)
title('The high-pass')
Also my problem is that i want all 3 plots to be displayed separately, and preferably in one window where you can see all at once, or if that's not possible then where all 3 figure-windows will appear.


Shraddha Jain
Shraddha Jain 2020년 12월 23일
I understand that you are getting this warning when the play function is executed. This occurs because the stop index value (get(player, 'SampleRate')*10) specified in the arguments of play function exceeds the end index value of audio variable x.
To answer you question regarding displaying figures seperately, you can use the following code,
plot(1:Rows, POVylo)
plot(1:Rows, POVybd)
plot(1:Rows, POVyhi)

Community Treasure Hunt

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

Start Hunting!

Translated by