![]() ![]() % Play back the recording play (recobj): % Store data in double-precision array nyRecording getaudiodata recobj) % Plot the 8asples plot (myRecording) In the above, the array myRecording contains the voice data, which can be processed. recordblocking(recobj, 5): disp('End of Recording. Capture the numerie signal data and create a plot (from Mathworks) % Record your voice for 5 seconds recobj audiorecorder (8000, 16, 1) disp( Start speaking. Create a numeric array corresponding to the signal data using the getaudiodata: xxgetaudiodata(audiobject) For example, connect a microphone to your system and record your voice for 5 seconds. Call record or recordblocking: > record (audiobject) >stop(audiobject) % record opens a channel that links to audiobject % stop closes the channel if you do not close the channel % recording continues and audiobject cannot be accessed > recordblocking(audiobject, 5) % record a fixed duration of 5 seconds into audiobject. 1 use 2 for stereo recording % (need stereo microphone) % you may try other numbers. 80 values for each second of sound % rabit 16 use 2 bytes to represent a value % nchannel. 1) % an object here is like a device or channel % fs. To reoord data from an audio input device (such as a microphone connected to your system) for processing in MATLAB, follow the sequence below Create an audiorecorder object: > audiobjct audiorecorder (8000, 16. ![]() 2.5 Recording and Playing Sounds in MATLAB (For Homework) You can also record your own sound with MATLAB.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |