Load/play/manipulate sound files
| Signature | hs.sound.getAudioEffectNames() -> table |
|---|---|
| Type | Function |
| Description | Gets a table of installed Audio Units Effect names. |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/sound/internal.m |
| Signature | hs.sound.soundFileTypes() -> table |
|---|---|
| Type | Function |
| Description | Gets the supported sound file types |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/sound/internal.m |
| Signature | hs.sound.soundTypes() -> table |
|---|---|
| Type | Function |
| Description | Gets the supported UTI sound file formats |
| Parameters |
|
| Returns |
|
| Source | extensions/sound/internal.m |
| Signature | hs.sound.systemSounds() -> table |
|---|---|
| Type | Function |
| Description | Gets a table of available system sounds |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/sound/internal.m |
| Signature | hs.sound.getByFile(path) -> sound or nil |
|---|---|
| Type | Constructor |
| Description | Creates an `hs.sound` object from a file |
| Parameters |
|
| Returns |
|
| Source | extensions/sound/internal.m |
| Signature | hs.sound.getByName(name) -> sound or nil |
|---|---|
| Type | Constructor |
| Description | Creates an `hs.sound` object from a named sound |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/sound/internal.m |
| Signature | hs.sound:currentTime([seekTime]) -> soundObject | seconds |
|---|---|
| Type | Method |
| Description | Get or set the current seek offset within an `hs.sound` object. |
| Parameters |
|
| Returns |
|
| Source | extensions/sound/internal.m |
| Signature | hs.sound:device([deviceUID]) -> soundObject | UID string |
|---|---|
| Type | Method |
| Description | Get or set the playback device to use for an `hs.sound` object |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/sound/internal.m |
| Signature | hs.sound:duration() -> seconds |
|---|---|
| Type | Method |
| Description | Gets the length of an `hs.sound` object |
| Parameters |
|
| Returns |
|
| Source | extensions/sound/internal.m |
| Signature | hs.sound:isPlaying() -> bool |
|---|---|
| Type | Method |
| Description | Gets the current playback state of an `hs.sound` object |
| Parameters |
|
| Returns |
|
| Source | extensions/sound/internal.m |
| Signature | hs.sound:loopSound([loop]) -> soundObject | bool |
|---|---|
| Type | Method |
| Description | Get or set the looping behaviour of an `hs.sound` object |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/sound/internal.m |
| Signature | hs.sound:name([soundName]) -> soundObject | name string |
|---|---|
| Type | Method |
| Description | Get or set the name of an `hs.sound` object |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/sound/internal.m |
| Signature | hs.sound:pause() -> soundObject | bool |
|---|---|
| Type | Method |
| Description | Pauses an `hs.sound` object |
| Parameters |
|
| Returns |
|
| Source | extensions/sound/internal.m |
| Signature | hs.sound:play() -> soundObject | bool |
|---|---|
| Type | Method |
| Description | Plays an `hs.sound` object |
| Parameters |
|
| Returns |
|
| Source | extensions/sound/internal.m |
| Signature | hs.sound:resume() -> soundObject | bool |
|---|---|
| Type | Method |
| Description | Resumes playing a paused `hs.sound` object |
| Parameters |
|
| Returns |
|
| Source | extensions/sound/internal.m |
| 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 |
|
| Source | extensions/sound/internal.m |
| Signature | hs.sound:stop() -> soundObject | bool |
|---|---|
| Type | Method |
| Description | Stops playing an `hs.sound` object |
| Parameters |
|
| Returns |
|
| Source | extensions/sound/internal.m |
| 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 |
|
| Source | extensions/sound/internal.m |
| Signature | hs.sound:volume([level]) -> soundObject | number |
|---|---|
| Type | Method |
| Description | Get or set the playback volume of an `hs.sound` object |
| Parameters |
|
| Returns |
|
| Source | extensions/sound/internal.m |