Load/play/manipulate sound files
| Signature | hs.sound.soundFileTypes() -> table |
|---|---|
| Type | Function |
| Description | Gets the supported sound file types Parameters:
Returns:
Notes:
|
| Signature | hs.sound.soundTypes() -> table |
|---|---|
| Type | Function |
| Description | Gets the supported UTI sound file formats Parameters:
Returns:
|
| Signature | hs.sound.systemSounds() -> table |
|---|---|
| Type | Function |
| Description | Gets a table of available system sounds Parameters:
Returns:
Notes:
|
| Signature | hs.sound.getByFile(path) -> sound or nil |
|---|---|
| Type | Constructor |
| Description | Creates an Parameters:
Returns:
|
| Signature | hs.sound.getByName(name) -> sound or nil |
|---|---|
| Type | Constructor |
| Description | Creates an Parameters:
Returns:
Notes:
|
| Signature | hs.sound:currentTime([seekTime]) -> soundObject | seconds |
|---|---|
| Type | Method |
| Description | Get or set the current seek offset within an Parameters:
Returns:
|
| Signature | hs.sound:device([deviceUID]) -> soundObject | UID string |
|---|---|
| Type | Method |
| Description | Get or set the playback device to use for an Parameters:
Returns:
Notes:
|
| Signature | hs.sound:duration() -> seconds |
|---|---|
| Type | Method |
| Description | Gets the length of an Parameters:
Returns:
|
| Signature | hs.sound:isPlaying() -> bool |
|---|---|
| Type | Method |
| Description | Gets the current playback state of an Parameters:
Returns:
|
| Signature | hs.sound:loopSound([loop]) -> soundObject | bool |
|---|---|
| Type | Method |
| Description | Get or set the looping behaviour of an Parameters:
Returns:
Notes:
|
| Signature | hs.sound:name([soundName]) -> soundObject | name string |
|---|---|
| Type | Method |
| Description | Get or set the name of an Parameters:
Returns:
Notes:
|
| Signature | hs.sound:pause() -> soundObject | bool |
|---|---|
| Type | Method |
| Description | Pauses an Parameters:
Returns:
|
| Signature | hs.sound:play() -> soundObject | bool |
|---|---|
| Type | Method |
| Description | Plays an Parameters:
Returns:
|
| Signature | hs.sound:resume() -> soundObject | bool |
|---|---|
| Type | Method |
| Description | Resumes playing a paused Parameters:
Returns:
|
| Signature | hs.sound:setCallback(function) -> soundObject |
|---|---|
| Type | Method |
| Description | Set or remove the callback for receiving completion notification for the sound object. Parameters:
Returns:
Notes:
|
| Signature | hs.sound:stop() -> soundObject | bool |
|---|---|
| Type | Method |
| Description | Stops playing an Parameters:
Returns:
|
| Signature | hs.sound:stopOnReload([stopOnReload]) -> soundObject | bool |
|---|---|
| Type | Method |
| Description | Get or set whether a sound should be stopped when Hammerspoon reloads its configuration Parameters:
Returns:
Notes:
|
| Signature | hs.sound:volume([level]) -> soundObject | number |
|---|---|
| Type | Method |
| Description | Get or set the playback volume of an Parameters:
Returns:
|