How to set the volume of beep sound and save it as wav?

2 ビュー (過去 30 日間)
Takara Sumoto
Takara Sumoto 2019 年 9 月 17 日
コメント済み: Takara Sumoto 2019 年 9 月 17 日
I want to make a beep sound which volume is adjustable and save it as a wavefile.
If I use this code below, I can adjust volume but I don't know how to save as wav.
%Beep
Beeper(400, [0.3], [0.5]);
(↑function Beeper(frequency, [fVolume], [durationSec]);
Then if I use this code below, I don't know how to set the volume and save.
% generate a beep
beepWaveform = MakeBeep(1000,.300,44100);
Thank you for your help.

採用された回答

Walter Roberson
Walter Roberson 2019 年 9 月 17 日
You forgot to mention that you are using Psychtoolbox 3.
audiowrite('NameOfWavFile.wav', beepWaveform, 44100);
However, it is not possible to save a volume inside of a sound file. The sound playing routines have no interface to system volume settings, and have no interface to volume adjustment of any pre-amp and/or amplifier that the speakers are connected to.
  1 件のコメント
Takara Sumoto
Takara Sumoto 2019 年 9 月 17 日
I see.
Thank you it worked!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by