Skip to content

Package with sound files and function to play them.

License

Notifications You must be signed in to change notification settings

m053m716/-sounds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

+sounds

Package with sound files (if initialized repo with Git-LFS) and function to play them.

Usage

GIT

To add this file as a submodule package to a MATLAB project:

  1. Open a git bash in the desired project folder.
  2. Use the following syntax to add the submodule as a package folder:
git submodule add https://github.com/m053m716/-sounds +sounds

MATLAB

Play the default alert sound.

sounds.play();

Play a specific sound (add more .mat files to package and use their name).

  • Current options are: 'alert', 'bell', 'camera', or 'pop'
  • See the adding sounds for file format.
sounds.play('camera');

Play the alert sound with twice the frequency (twice as fast).

sounds.play('alert', 2);

Play the alert sound at the normal frequency but with 50 dB attenuation.

  • Note: the signal is first normalized so that its maximum absolute deviation is equal to one, then attenuated.
sounds.play('alert', 1, -50);

Adding Sounds

All sound files are in .mat ('-v7.3') files. Each file contains two variables:

  • sfx - The sound-effect vector, a 1 x nSamples (single) vector of the audio waveform.
    • Note: output is automatically rescaled by its maximum value prior to applying any attenuation.
  • fs - The sample frequency of the file (Hz). Default value is 44100 (double).

Version Info

  • Initial: MATLAB Version 9.2.0.538062 (R2017a) 06-Aug-2020
  • Current: MATLAB Version: 9.9.0.1592791 (R2020b) Update 5
    • Operating System: Microsoft Windows 10 Home Version 10.0 (Build 19042)
    • Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode

About

Package with sound files and function to play them.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages