Need help with Volume Slider Function(arguments)
이전 댓글 표시
Hello everyone, I've been trying to code an audio player for wav files throught the Matlab GUI.
Currently stuck on the volume slider function.
Is my conversion right? What arguments should I use for guidata?
Asking because it has different arguments than the function below I found online.
MY CODE SO FAR FOR THE VOLUME SLIDER:


MY CODE FOR THE STATE BUTTON(PLAY/PAUSE):

FUNCTION I FOUND ONLINE:


Thanks in advance
댓글 수: 9
Geoff Hayes
2022년 4월 1일
@Nikos Korobos - have you created your GUI with App Designer? It looks like the code that you have found for the slider callback is from a GUI created with GUIDE and so the guidata would not be appropriate for you to use with your GUI (if created with App Designer).
Nikos Korobos
2022년 4월 1일
Geoff Hayes
2022년 4월 1일
@Nikos Korobos - have you confirmed, using the MATLAB debugger, that
x = x(NewStart:end,:);
is a subset of x with NewStart some integer other than 1?
Geoff Hayes
2022년 4월 1일
Or see FEX submission SoundVolume - set or get the system speaker sound volume which may work for you and allow you to control the volume without stopping and restarting the audio player object.
Nikos Korobos
2022년 4월 4일
Geoff Hayes
2022년 4월 4일
I/m not sure if there is an alternative to using Java. Did you try debugging to see why the audio restarts at the first sample?
Mohamed Turkmani
2022년 9월 7일
@Geoff Hayes i downloaded the function of SoundVolume , how can i use it?
Geoff Hayes
2022년 9월 8일
% SoundVolume(volume) sets the system speaker sound volume. The volume
% value should be numeric, between 0.0 (=muted) and 1.0 (=max).
So you would call the function from the command line or from code as
SoundVolume(0.5)
or some other value (between 0 and 1) that would change the volume.
Mohamed Turkmani
2022년 9월 8일
Yes i fuhured it out thanks for the reply
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Audio and Video Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!