Not enough input arguments.
Error in im2sound (line 31)
raw_im = imread(strcat(filename,'.',ext));
I am using an old image to sound code (this), and I had this error and I am new so I don't know how to fix. I also changed wavwrite to audiowrite so no problem with that.

 Akzeptierte Antwort

DGM
DGM am 23 Mär. 2022

0 Stimmen

The error is occurring because you're calling without specifying one of the first two arguments. You need to provide all arguments when you call the function.

5 Kommentare

thanks, but I have deeper errors now, here:
Error using audiowrite
The value of 'filename' is invalid. Expected input to be one of these types:
%How can I make it char or string? I just typed the sos.png's 'sos'.%
char, string
Instead its type was double.
Error in audiowrite>parseInputs (line 294)
parse(p,filename, y, Fs, pvpairs{:});
Error in audiowrite (line 127)
props = parseInputs(filename, y, Fs, varargin);
Error in im3sound (line 92)
audiowrite(final_sound, f_sample, strcat(filename, '.wav'));
Error in im2soundd (line 1)
im3sound('sos','png', 44000 ,40,6000, 0.00002,10);
audiowrite(final_sound, f_sample, strcat(filename, '.wav'));
That is incorrect. The filename must go first for audiowrite()
DGM
DGM am 23 Mär. 2022
The syntax for audiowrite() is not the same as wavwrite(). You'll have to check argument order and compatibility.
Everything is good so far, no more errors, just one warning related to what I did here;
audiowrite(strcat(filename, '.wav'),final_sound,f_sample);
I typed '.wav' instead of 'wav' because of this error:
Error using audiowrite>validateExtension (line 373)
No file extension for file soswav.
Supported extensions are:
.flac
.m4a
.mp4
.oga
.ogg
.wav
Oh. Warning is:
Warning: Data clipped when writing file.
> In audiowrite>clipInputData (line 470)
In audiowrite (line 241)
In im3sound (line 92)
In im2soundd (line 2)
DGM
DGM am 24 Mär. 2022
Bearbeitet: DGM am 24 Mär. 2022
Yeah. You should be able to adjust the amp_mod parameter to reduce the amplitude. Depending on whether there are a bunch of spurious transitions created, there might be a few outliers anyway; I haven't checked how well it behaves. You could always truncate the data before writing it. It would be the same, but you wouldn't get the warning.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte

Version

R2021b

Gefragt:

am 23 Mär. 2022

Bearbeitet:

DGM
am 24 Mär. 2022

Community Treasure Hunt

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

Start Hunting!

Translated by