MasterScan  Lab_Matlab_control Master Branch
List of all members | Properties and Events | Protected Properties | Methods
dotsPlayableFile Class Reference

Overview

Play a sound from a .wav or .mp3 file.

Inheritance diagram for dotsPlayableFile:
Inheritance graph
[legend]

Properties and Events

Property fileName = ''
 string file name of a .wav or .mp3 file to play
 
Property isBlocking = true
 whether to play synchonously (true) or asynchronously More...
 
- Properties and Events inherited from dotsPlayable
Property isAudible = true
 true or false, whether this object should play() sonds
 
Property intensity = 1
 scale factor to apply to waveform during playback
 
Property sampleFrequency = 44100
 frequency in Hz of sound samples stored in waveform
 
Property bitsPerSample = 16
 bit-depth of each sound sample in waveform
 
Property duration
 duration of the sound to play (may be set automatically)
 
Property soundsPath
 system path to locate sound files
 
Property waveform
 mXn double matrix of sound samples (arbitrary units, 0-1) More...
 
Property side = ''
 If a sound should only play in the left side or right side. More...
 
Property playBlocking = false
 Should we block until done?
 

Protected Properties

Property player
 Matlab audioplayer object.
 
- Protected Properties inherited from dotsPlayable
Property lastPlayTime
 timestamp from the last time this object was play()ed
 

Methods

self dotsPlayableFile ()
 Constructor takes no arguments.
 
 prepareToPlay (self)
 Read audio data from the the sound file.
 
 play (self)
 Play from the sound file.
 
- Methods inherited from dotsPlayable
self dotsPlayable ()
 Constructor takes no arguments.
 
 mayPlayNow (self)
 play() or not, depending on isAudible and possibly other factors.
 
 prepareToPlay (self)
 Do any pre-play setup.
 
 play (self)
 Subclass must redefine play() to play a sound.
 
 stopPlaying (self, waitForEndOfPlayback)
 Subclass must redefine stopPlaying() to stop playing a sound.
 
 unMute (self)
 Shorthand to set isAudible=true.
 
 mute (self)
 Shorthand to set isAudible=false.
 

Additional Inherited Members

- Static Methods inherited from dotsPlayable
static playSound (playableList, indices)
 Pick a sound!
 

Properties and Events

◆ isBlocking

Property isBlocking = true

whether to play synchonously (true) or asynchronously

Be warned that using isBlocking = false can lead to errors because Matlab's audioplayer class is limited.


The documentation for this class was generated from the following file: