필터 지우기
필터 지우기

How can i do the real time sound volume change in GUI?

조회 수: 4 (최근 30일)
HS Kim
HS Kim 2016년 11월 29일
댓글: Mohamed Turkmani 2022년 9월 6일
%
A = get(handles.Volume_Slider,'Value');
TempSound = TempFft;
RestoredAudio = real(ifft(TempSound));
sound(A*RestoredAudio,fs/2)
%
I used slider Bar in Gui
If i want to change the volumn of sound, then I have to press play button again after chaning slider bar
How can I change in real time?
I want to change the volumn by just moving of slider bar
Like this equalizer

채택된 답변

Walter Roberson
Walter Roberson 2016년 11월 30일
1) Use audioplayer:
Divide the sound up into chunks. For each chunk, multiply the contents of the chunk by the current volume settting, create an audioplayer object, set the StopFcn of the audioplayer, and play() the audioplayer. The StopFcn, when triggered, should do the same thing for the next chunk (looking at the then-current volume level) and then delete the current audioplayer.
2) Use dsp.AudioPlayer or audioDeviceWriter() from DSP toolbox. You need to queue multiple samples at a time, but you do not need to keep deleting and creating new players.
  댓글 수: 4
HS Kim
HS Kim 2016년 12월 3일
I found CurrentSample by player = audioplayer(y,fs) and get(player) and i did!!!!
Thanks a lot:D
Mohamed Turkmani
Mohamed Turkmani 2022년 9월 6일
@HS Kim can you please explain how did you do it?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by