เอกสาร matlablanguage อ่านเสียง

รหัสตัวอย่าง

1
0

เอกสาร matlablanguage อ่านเสียง

function play(speed, volume)
% PLAY plays an audio file
% 
% The first optional argument is speed
% 1 is normal speed, 0.5 is half speed, 2 is double speed
% 
% The second argument is volume
% 1 is normal volume, 0.5 is half volume, 2 is double volume
% 
% Both speed and volume's default values are 1
% 
% hal() is speed 1, volume 1
% 
% hal(2) is speed 2, volume 1
%
% hal(1, 2) is speed 1, volume 2

    arguments
        speed (1, 1) double = 1;
        volume (1, 1) double = 1;
    end

%This audioread function below reads the audio
[y, Fs] = audioread('audiofile.wav');
sound(y * volume, Fs * speed)
end

หน้าคล้ายกัน

คล้ายกันหน้ากับตัวอย่าง

ในภาษาอื่นๆ

หน้านี้อยู่ในภาษาอื่นๆ

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................