how can I play audio in matlab?

I want to play voices under 20 Hz (above the humen hearing range). if possible, I don't want to use external audio-file. is there any function that playing single tone by typing the wanted frequency?

2 Comments

Something's wrong here: "under 20 Hz (above the humen hearing range)". If you're a human and something like 15 hertz is above your hearing range, then I'd say that you're very remarkable and unusual. Most humans hear in the nominal range 20 - 20,000 Hz.
you right... insted of 'above' i should write 'under'. I want to play voices that we can't hear but a microphone can. I also want that during the playing a graph will apeare so the user will notice that the 'un-hearble' sound is being played. I succeed with the record - now i want to plot it while it played...

Sign in to comment.

Answers (1)

Geoff Hayes
Geoff Hayes on 17 Jun 2015
Eran - see http://www.mathworks.com/matlabcentral/answers/134304-how-do-i-generate-sound-using-matlab which describes a couple of ways of generating sound using MATLAB. In particular, the use of the sound function (answer by Azzi Abdelmalek) or Image Analyst's demo that creates a sound and plays it.

4 Comments

thanks, I used the 'sound' function to play my file. do you know how to plot the voice I'm playing? I want to see the graph of the voice simultaneously.
Using the plot command? What do you mean by "simultaneously"?
I want taht the graph will be paint during the playing, and not after it finished...
eran - since you want to play and process (plot) the audio file simultaneously, you may want to use the audioplayer instead. See http://www.mathworks.com/matlabcentral/answers/222105-make-the-slider-move-as-the-music-is-playing which includes a demo GUI which can play and plot an audio file using a timer.

Sign in to comment.

Asked:

on 17 Jun 2015

Commented:

on 22 Jun 2015

Community Treasure Hunt

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

Start Hunting!