Having A Problem With WAVRECORD

4 ビュー (過去 30 日間)
Pao
Pao 2013 年 11 月 21 日
回答済み: Pao 2013 年 11 月 21 日
My code is like this:
function pbAudio_Callback(hObject, eventdata, handles)
x = handles.slctdBtn;
get(handles.edtSeconds,'String')
if(strcmp(x,'rbRecord'))
myAudio = wavrecord(get(handles.edtSeconds,'String')*11025,11025);
wavwrite(myAudio,11025,'hmm.wav')
end
wavplay(myAudio,11025)
The handles.edtSeconds returns the desirable value. The problem is the wavrecord does not record the specified number of seconds I entered. One example is I entered 1 in edtSeconds edit box, and the audio file recorded was good for 48 seconds (I saved the file).
It seems that I can get it work by replacing the numeric value of the edtSeconds.

採用された回答

Pao
Pao 2013 年 11 月 21 日
I got it now. Since the value of the get(handles.edtSeconds,'String') isn't converted into a number yet that's why it isn't working correctly.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by