Converting code to use wavread to audioread
20 ビュー (過去 30 日間)
古いコメントを表示
In new versions of MATLAB wavread is no longer supported. This could be used to get information from the additional information sections of the file, including custom fields.
[y, Fs, nbits, opts] = wavread(filename) returns a structure opts of additional information contained in the WAV file. The content of this structure differs from file to file. Typical structure fields include opts.fmt (audio format information) and opts.info (text that describes the title, author, etc.).
audioread has no such facility and audioinfo is very ridged and limited (not allowing the read of custom fields).
What is the way around this, as I am trying to get some pre-existing code working in the new version?
3 件のコメント
Louise Wilson
2019 年 4 月 30 日
Hi AndyLAB,
Did you resolve this? I am now having the same issue, using code that a previous student wrote to batch analyse audio files.
I can get Fs with audioread, but not nbits.
Thanks!
回答 (1 件)
Sachin Kumar
2017 年 5 月 9 日
While writing data to your audio file, you can write your custom data/info as comment and you can read the same info in comment section using audioinfo() function. Check this example:
1 件のコメント
Santosh Xavier
2019 年 6 月 14 日
Faced same issue, resolved it using the following steps to get nbits
aInfo = audioinfo(wavfilename);
nbits = aInfo.BitsPerSample;
参考
カテゴリ
Help Center および File Exchange で Audio and Video Data についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!