音声データ(1次元デ​ータ)からデータを一​部を抽出する方法につ​いて

[x,fs]=audioread("output3.wav")
音声データからデータの一部を抜き取る方法を教えていただきたいです。(1~50000点など)
簡単な質問になりますがご教授のほどよろしくお願いします。

Réponses (1)

Atsushi Ueno
Atsushi Ueno le 1 Nov 2022

0 votes

load handel.mat
audiowrite("output3.wav",y,Fs); % サンプル handel.mat の音声データをファイルに書き込んだ
clear y Fs
[x,fs] = audioread("output3.wav"); % 再度ファイルを読み取る
size(x) % このサンプル handel.mat の音声データは73113点の長さがある
ans = 1×2
73113 1
y = x(1:50000);
size(y) % データの一部(1~50000点)を抜き取った
ans = 1×2
50000 1
sound(y,fs); % 曲の途中で止まる事を確認できる

1 commentaire

一秀 近藤
一秀 近藤 le 2 Nov 2022
わかりやすい回答ありがとうございました!参考にさせていただきます!

Connectez-vous pour commenter.

Catégories

En savoir plus sur Measurements and Spatial Audio dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!