File Read/Write problems
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi all, I'm having a simple code problem ,here is the code:
% create an example sound
t = 0:0.0001:3;
x = 0.9*cos(2*pi*440*t);
% play it back
sound(x, 8000);
wavwrite(x, 8000, 16, example_sound.wav);_
it gives an error :
Error in ==> play123 at 6 wavwrite(x, 8000, 16, example_sound.wav);
plz help! I'm also having similar problems with image processing (i also have all the requires toolboxes)
2 Kommentare
Jan
am 12 Feb. 2012
You've posted the line, where the error appears, but not the descrption of the problem.
Image Analyst
am 12 Feb. 2012
What is the image processing problem? Why don't you post a separate question on that, if you still have problems that enclosing the filename in quotes did not fix?
Antworten (2)
Jan
am 12 Feb. 2012
I guess, that you did not store the file name in a struct called example_sound in the field wav, but you want to use this as a file name. Then it must be defined as a string using quotes:
wavwrite(x, 8000, 16, 'example_sound.wav')
0 Kommentare
Masab Ahmad
am 13 Feb. 2012
1 Kommentar
Jan
am 13 Feb. 2012
@Massab: Please accept the answer to show, that your problem is solved. Comments to answers should be posted as comments, not as additional answers. Thanks.
Siehe auch
Kategorien
Mehr zu Audio and Video Data finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!