4/5/2023 0 Comments Play sound in matlab![]() ![]() When frequency at which your data was sampled doesn't match any of sampling frequencies supported by your sound card, you need to (up/down)sample it to have it played with the "correct" speed and pitch. ![]() Available devices and sampling frequencies which they support can be checked using function audiodevinfo. MATLAB® plays the scaled audio with a bit depth of 16 bits per sample, if this bit depth is supported on your system. Use one of the sampling frequencies supported by your sound card. It's not strange then that with sampling frequency of 256Hz you get the error. MATLAB has a hard restriction of 1000 Hz <= Fs <= 384000 Hz, although further hardware-dependent restrictions apply. The signal y is scaled to the range -1.0 y 1.0 before it is played, resulting in a sound that is played as loud as possible without clipping. ![]() soundsc (y,Fs): sends the signal in vector y (with sample frequency Fs) to the speaker on the PC and most UNIX platforms. Valid values depend on both the sample rates permitted by MATLAB® and the specific audio hardware on your system. Stereo sound is played on platforms that support it when y is an n-by-2 matrix. This MATLAB function scales the values of audio signal y to fit in the range from 1 to 1, and then sends the data to the speaker at the default sample rate. If you look into documentation of soundsc:įs: Sample rate, in hertz, of audio data y, is specified as a positive number from 1000 through 384000. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |