Borrar filtros
Borrar filtros

Need help with Volume Slider Function(arguments)

1 visualización (últimos 30 días)
Nikos Korobos
Nikos Korobos el 1 de Abr. de 2022
Comentada: Mohamed Turkmani el 8 de Sept. de 2022
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 comentarios
Geoff Hayes
Geoff Hayes el 8 de Sept. de 2022
@Mohamed Turkmani - from the function description at SoundVolume functions
% 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
Mohamed Turkmani el 8 de Sept. de 2022
Yes i fuhured it out thanks for the reply

Iniciar sesión para comentar.

Respuesta aceptada

Jakub Devera
Jakub Devera el 1 de Abr. de 2022
You should be able to get the volume
Volume = app.VolumeSlider.Value;
It is a public property.
I am not sure what you want to achieve by the last line guidata, but this is not used in App Designer as @Geoff Hayes menitoned in the comment.
  1 comentario
Nikos Korobos
Nikos Korobos el 1 de Abr. de 2022
Hello, my main issue is that i need to make the slider swtich volume levels but with the sound file playing.
At this point, my slider does work but it resets the progress of the file playing and starts over instead of continuing from the point I used the volume slider.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by