I want to increase/decrease volume of audio file using the slider,is it necessary to run audio data from slider?
Show older comments
global filename;
[y,Fs] = audioread(filename);
slider_val = get(hObject, 'Value');
if slider_val == 0
x = y/5; % Decrease volume
player = audioplayer(x, Fs);
play(player,[1 (get(player, 'SampleRate')*3)]);
elseif slider_val == 1
x = y*5; % Increase volume
player = audioplayer(x, Fs);
play(player,[1 (get(player, 'SampleRate')*3)]);
Accepted Answer
More Answers (0)
Categories
Find more on Audio and Video Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!