How can I control the timing of playing a sound?

16 ビュー (過去 30 日間)
Chelsea
Chelsea 2014 年 11 月 12 日
コメント済み: Star Strider 2014 年 11 月 12 日
Hi,
I'm trying to play a sound (clip is 10 seconds) for 5 seconds. How can I stop the sound after 5 seconds? I also want to play this sound file at 75 decibels. I know the function...
soundsc(y,[-.75 .75]);
How does this relate to decibels?
Thanks!

採用された回答

Star Strider
Star Strider 2014 年 11 月 12 日
If you have a sound clip of length(y) = n, create y2 = y(1:fix(n/2),:) assuming y is a (nx2) array, then soundsc(y2) will play it for half the time y would play.
The intensity of the sound in dB is not determined by the sound functions in MATLAB but rather by the amplifier characteristics that output it to the whatever transducer you choose to use (speaker, headphones, etc.). You need to calibrate your sound system to determine and set the sound intensity.
  2 件のコメント
Chelsea
Chelsea 2014 年 11 月 12 日
Thanks!
Star Strider
Star Strider 2014 年 11 月 12 日
My pleasure!

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by