getaudiodata
録音したオーディオ信号の数値配列への保存
説明
例
オーディオ レコーダー オブジェクトからデータを取得
audiorecorder
オブジェクトを使用して録音を作成し、オーディオ信号を様々なデータ型の数値配列として取得します。
audiorecorder
オブジェクトを作成し、マイクから 5 秒間のオーディオ クリップを録音します。
recObj = audiorecorder;
disp('Start speaking.')
Start speaking.
recordblocking(recObj,5);
disp('End of Recording.');
End of Recording.
オーディオ信号を double
配列として取得し、データをプロットします。
doubleArray = getaudiodata(recObj);
plot(doubleArray);
title('Audio Signal (double)');
オーディオ信号を int8
配列として取得し、データをプロットします。指定したデータ型に基づき、同じオーディオ信号が様々な範囲の値を使用して返されます。この場合、int8
配列の値は -128
と 127
の範囲にあります。
int8Array = getaudiodata(recObj,'int8'); plot(int8Array); title('Audio Signal (int8)');
入力引数
recorder
— オーディオ レコーダー オブジェクト
audiorecorder
オブジェクト
オーディオ レコーダー オブジェクト。audiorecorder
オブジェクトとして指定します。このオブジェクトを作成するには、関数 audiorecorder
を使用します。
dataType
— データ型
'double'
(既定値) | 'single'
| 'int16'
| 'int8'
| 'uint8'
出力オーディオ信号のデータ型。'double'
、'single'
、'int16'
、'int8'
、'uint8'
の値のいずれかとして指定します。
データ型: char
| string
出力引数
y
— オーディオ信号データ
数値配列
オーディオ信号データ。数値配列として返されます。
y
の列数は、録音のチャネル数によって決まります。モノラルの場合は 1、ステレオの場合は 2 です。
y
の値の範囲は、指定した dataType
によって決まります。
データ型 | サンプル値の範囲 |
---|---|
| -128 ~ 127 |
| 0 ~ 255 |
| -32,768 ~ 32,767 |
| -1 ~ 1 |
バージョン履歴
R2006a で導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)