Skip to content

Clearer documentation for play_sound() #4

@rocamocha

Description

@rocamocha

It is unclear as to how this works before doing a deep dive into the code and dissecting when it is called by other parts of the program. I suggest the following change to the API entry to make it easy to understand how to use the feature without having to dissect the code:

By default this function is empty, and is called every time a new letter appears. When called in this way, the value paired to the key "sound" within the letter's style table is passed as the name parameter if it exists. this makes it possible to define the sound to play per letter through the styling table by overriding the empty function with the following:

printer.play_sound = function(name)
  sound.play("sounds#" .. name)
end

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions