sound関数を使うと「入力引数が多すぎます」とでる
74 views (last 30 days)
Show older comments
wavファイルからy1とFs1の情報を取得しsound関数の引数としたら以下のエラーが発生しました.
>> sound(y1, Fs1)
次を使用中のエラー: sound
入力引数が多すぎます。
引数のサイズは
>> size(y1)
ans =
614400 1
>> size(Fs1)
ans =
1 1
です.
どうすればこの音源を再生できますでしょうか.
Accepted Answer
Atsushi Ueno
on 14 May 2023
What is the calling priority for MATLAB functions? - MATLAB Answers - MATLAB Central (mathworks.com)
可能性のある原因を再現するプログラムと添付ファイルを準備しました。
コメントを外して、現在のフォルダ (Pathの通っているフォルダ) にある sound.m を別フォルダ (Pathの通っていないフォルダ) に移動させると、MATLAB組み込みの sound 関数の方が優先して実行される事を確認する事が出来ます。
type sound % 添付ファイル sound.m の中身を表示(入力を出力に渡すだけ)(引数が1つ存在しなければ警告を出す)
load gong.mat
%mkdir other
%movefile sound.m other
sound(y,Fs);
2 Comments
Atsushi Ueno
on 14 May 2023
どの sound 関数が実行されるのか確認する方法です。MATLAB組み込みの sound 関数が使用出来る場合は、下記に近い結果になり、当該エラーが発生している状況では、パスの通った場所に同名の sound 関数が存在するはずです。
which sound
More Answers (0)
See Also
Categories
Find more on Measurements and Spatial Audio in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!